S3ToolSchema

class aws_cdk.aws_bedrock_agentcore_alpha.S3ToolSchema(location, bucket_owner_account_id=None)

Bases: ToolSchema

(experimental) Class to define a Tool Schema from an S3 object.

Stability:

experimental

ExampleMetadata:

infused

Example:

tool_schema = agentcore.ToolSchema.from_s3_file(
    s3.Bucket.from_bucket_name(self, "SchemasBucket", "my-schemas-bucket"), "tools/complex-tool-schema.json", "123456789012")
Parameters:
  • location (Union[Location, Dict[str, Any]])

  • bucket_owner_account_id (Optional[str]) – The account ID of the S3 bucket owner for cross-account access.

Stability:

experimental

Methods

bind(scope)

(experimental) Bind the schema to a construct.

Parameters:

scope (Construct)

Stability:

experimental

Return type:

None

grant_permissions_to_role(role)

(experimental) Grant permissions to the role.

Parameters:

role (IRole)

Stability:

experimental

Return type:

None

Attributes

bucket_owner_account_id

(experimental) The account ID of the S3 bucket owner for cross-account access.

Stability:

experimental

inline_schema

(experimental) The inline tool schema definition as a string, if using an inline schema.

Can be in JSON or YAML format.

Stability:

experimental

s3_file

(experimental) The S3 location of the tool schema file, if using an S3-based schema.

Contains the bucket name and object key information.

Stability:

experimental

Static Methods

classmethod from_inline(schema)

(experimental) Creates a Tool Schema from an inline string.

Parameters:

schema (Sequence[Union[ToolDefinition, Dict[str, Any]]]) –

  • the JSON or YAML payload defining the OpenAPI schema for the action group.

Stability:

experimental

Return type:

InlineToolSchema

classmethod from_local_asset(path)

(experimental) Creates a tool Schema from a local file.

Parameters:

path (str) –

  • the path to the local file containing the function schema for the tool.

Stability:

experimental

Return type:

ToolSchema

classmethod from_s3_file(bucket, object_key, bucket_owner_account_id=None)

(experimental) Creates a Tool Schema from an S3 File.

Parameters:
  • bucket (IBucket) –

    • the bucket containing the local file containing the OpenAPI schema for the action group.

  • object_key (str) –

    • object key in the bucket.

  • bucket_owner_account_id (Optional[str]) –

    • optional The account ID of the Amazon S3 bucket owner. This ID is used for cross-account access to the bucket.

Stability:

experimental

Return type:

S3ToolSchema