S3ToolSchema Class
Class to define a Tool Schema from an S3 object.
Example
ts
const toolSchema = agentcore.ToolSchema.fromS3File(
s3.Bucket.fromBucketName(this, "SchemasBucket", "my-schemas-bucket"),
"tools/complex-tool-schema.json",
"123456789012"
);
python
tool_schema = agentcore.ToolSchema.from_s3_file(
s3.Bucket.from_bucket_name(self, "SchemasBucket", "my-schemas-bucket"), "tools/complex-tool-schema.json", "123456789012")
java
S3ToolSchema toolSchema = ToolSchema.fromS3File(Bucket.fromBucketName(this, "SchemasBucket", "my-schemas-bucket"), "tools/complex-tool-schema.json", "123456789012");
csharp
// Install: dotnet add package Amazon.CDK.Lib
var toolSchema = ToolSchema.FromS3File(Bucket.FromBucketName(this, "SchemasBucket", "my-schemas-bucket"), "tools/complex-tool-schema.json", "123456789012");
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
toolSchema := agentcore.ToolSchema_FromS3File(s3.Bucket_FromBucketName(this, jsii.String("SchemasBucket"), jsii.String("my-schemas-bucket")), jsii.String("tools/complex-tool-schema.json"), jsii.String("123456789012"))
Initializer
ts
new S3ToolSchema(location: Location, bucketOwnerAccountId?: string)
python
S3ToolSchema(location: Location, bucket_owner_account_id: typing.Optional[str] = None)
java
new S3ToolSchema(Location location, String bucketOwnerAccountId)
csharp
new S3ToolSchema(Location location, string? bucketOwnerAccountId = null)
Properties
bucketOwnerAccountIdmay be undefinedstringbucket_owner_account_idmay be undefinedstrbucketOwnerAccountIdmay be undefinedStringBucketOwnerAccountIdmay be undefinedstringBucketOwnerAccountIdmay be undefined*string#The account ID of the S3 bucket owner for cross-account access.
inlineSchemamay be undefinedToolDefinition[]inline_schemamay be undefinedtyping.List[ToolDefinition]inlineSchemamay be undefinedList<ToolDefinition>InlineSchemamay be undefinedToolDefinition[]InlineSchemamay be undefined*[]ToolDefinition#The inline tool schema definition as a string, if using an inline schema.
Can be in JSON or YAML format.
Methods
bind(scope: Construct): voiddef bind(self, scope: Construct) -> Nonepublic void bind(Construct scope)public void Bind(Construct scope)func Bind(Scope Construct)#Bind the schema to a construct.
fromInline(schema: ToolDefinition[]): InlineToolSchema@staticmethod def from_inline(schema: typing.List[ToolDefinition]) -> InlineToolSchemapublic static InlineToolSchema fromInline(List<ToolDefinition> schema)public static InlineToolSchema FromInline(ToolDefinition[] schema)func FromInline(Schema *[]ToolDefinition) InlineToolSchemastatic#Creates a Tool Schema from an inline string.
1 parameter
Parameters
schemaschemaschemaschemaSchema— - the JSON or YAML payload defining the OpenAPI schema for the action group.
fromLocalAsset(path: string): ToolSchema@staticmethod def from_local_asset(path: str) -> ToolSchemapublic static ToolSchema fromLocalAsset(String path)public static ToolSchema FromLocalAsset(string path)func FromLocalAsset(Path *string) ToolSchemastatic#Creates a tool Schema from a local file.
1 parameter
Parameters
pathpathpathpathPath— - the path to the local file containing the function schema for the tool.
fromS3File(bucket: IBucket, objectKey: string, bucketOwnerAccountId?: string): S3ToolSchema // chainable@staticmethod def from_s3_file(bucket: IBucket, object_key: str, bucket_owner_account_id: typing.Optional[str] = None) -> S3ToolSchemapublic static S3ToolSchema fromS3File(IBucket bucket, String objectKey, String bucketOwnerAccountId)public static S3ToolSchema FromS3File(IBucket bucket, string objectKey, string? bucketOwnerAccountId = null)func FromS3File(Bucket IBucket, ObjectKey *string, BucketOwnerAccountId *string) S3ToolSchemastatic#Creates a Tool Schema from an S3 File.
3 parameters
Parameters
bucketbucketbucketbucketBucket— - the bucket containing the local file containing the OpenAPI schema for the action group.objectKeyobject_keyobjectKeyobjectKeyObjectKey— - object key in the bucket.bucketOwnerAccountIdbucket_owner_account_idbucketOwnerAccountIdbucketOwnerAccountIdBucketOwnerAccountId— - optional The account ID of the Amazon S3 bucket owner.