Skip to content
v2.274.0

Experimental

@aws-cdk/aws-bedrock-agentcore-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

InlineToolSchema Class ​

Class to define a Tool Schema from an inline string.

The schema can be provided directly as a string in either JSON or YAML format.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as bedrock_agentcore_alpha from '@aws-cdk/aws-bedrock-agentcore-alpha';

declare const schemaDefinition_: bedrock_agentcore_alpha.SchemaDefinition;
const inlineToolSchema = new bedrock_agentcore_alpha.InlineToolSchema([{
  description: 'description',
  inputSchema: {
    type: bedrock_agentcore_alpha.SchemaDefinitionType.STRING,

    // the properties below are optional
    description: 'description',
    items: schemaDefinition_,
    properties: {
      propertiesKey: schemaDefinition_,
    },
    required: ['required'],
  },
  name: 'name',

  // the properties below are optional
  outputSchema: {
    type: bedrock_agentcore_alpha.SchemaDefinitionType.STRING,

    // the properties below are optional
    description: 'description',
    items: schemaDefinition_,
    properties: {
      propertiesKey: schemaDefinition_,
    },
    required: ['required'],
  },
}]);
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_bedrock_agentcore_alpha as bedrock_agentcore_alpha

# schema_definition_: bedrock_agentcore_alpha.SchemaDefinition

inline_tool_schema = bedrock_agentcore_alpha.InlineToolSchema([
    description="description",
    input_schema=bedrock_agentcore_alpha.SchemaDefinition(
        type=bedrock_agentcore_alpha.SchemaDefinitionType.STRING,

        # the properties below are optional
        description="description",
        items=schema_definition_,
        properties={
            "properties_key": schema_definition_
        },
        required=["required"]
    ),
    name="name",

    # the properties below are optional
    output_schema=bedrock_agentcore_alpha.SchemaDefinition(
        type=bedrock_agentcore_alpha.SchemaDefinitionType.STRING,

        # the properties below are optional
        description="description",
        items=schema_definition_,
        properties={
            "properties_key": schema_definition_
        },
        required=["required"]
    )
])
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.bedrock.agentcore.alpha.*;

SchemaDefinition schemaDefinition_;

InlineToolSchema inlineToolSchema = new InlineToolSchema(List.of(ToolDefinition.builder()
        .description("description")
        .inputSchema(SchemaDefinition.builder()
                .type(SchemaDefinitionType.STRING)

                // the properties below are optional
                .description("description")
                .items(schemaDefinition_)
                .properties(Map.of(
                        "propertiesKey", schemaDefinition_))
                .required(List.of("required"))
                .build())
        .name("name")

        // the properties below are optional
        .outputSchema(SchemaDefinition.builder()
                .type(SchemaDefinitionType.STRING)

                // the properties below are optional
                .description("description")
                .items(schemaDefinition_)
                .properties(Map.of(
                        "propertiesKey", schemaDefinition_))
                .required(List.of("required"))
                .build())
        .build()));
csharp
// Install: dotnet add package Amazon.CDK.AWS.Bedrock.Agentcore.Alpha
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Bedrock.Agentcore.Alpha;

SchemaDefinition schemaDefinition_;

var inlineToolSchema = new InlineToolSchema(new [] { new ToolDefinition {
    Description = "description",
    InputSchema = new SchemaDefinition {
        Type = SchemaDefinitionType.STRING,

        // the properties below are optional
        Description = "description",
        Items = schemaDefinition_,
        Properties = new Dictionary<string, SchemaDefinition> {
            { "propertiesKey", schemaDefinition_ }
        },
        Required = new [] { "required" }
    },
    Name = "name",

    // the properties below are optional
    OutputSchema = new SchemaDefinition {
        Type = SchemaDefinitionType.STRING,

        // the properties below are optional
        Description = "description",
        Items = schemaDefinition_,
        Properties = new Dictionary<string, SchemaDefinition> {
            { "propertiesKey", schemaDefinition_ }
        },
        Required = new [] { "required" }
    }
} });
go
// Install: go get github.com/aws/aws-cdk-go/awsbedrockagentcorealpha/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awsbedrockagentcorealpha"

var schemaDefinition_ SchemaDefinition

inlineToolSchema := bedrock_agentcore_alpha.NewInlineToolSchema([]ToolDefinition{
	&ToolDefinition{
		Description: jsii.String("description"),
		InputSchema: &SchemaDefinition{
			Type: bedrock_agentcore_alpha.SchemaDefinitionType_STRING,

			// the properties below are optional
			Description: jsii.String("description"),
			Items: schemaDefinition_,
			Properties: map[string]SchemaDefinition{
				"propertiesKey": schemaDefinition_,
			},
			Required: []*string{
				jsii.String("required"),
			},
		},
		Name: jsii.String("name"),

		// the properties below are optional
		OutputSchema: &SchemaDefinition{
			Type: bedrock_agentcore_alpha.SchemaDefinitionType_STRING,

			// the properties below are optional
			Description: jsii.String("description"),
			Items: schemaDefinition_,
			Properties: map[string]SchemaDefinition{
				"propertiesKey": schemaDefinition_,
			},
			Required: []*string{
				jsii.String("required"),
			},
		},
	},
})

Initializer ​

ts
new InlineToolSchema(schema: ToolDefinition[])
python
InlineToolSchema(schema: typing.List[ToolDefinition])
java
new InlineToolSchema(List<ToolDefinition> schema)
csharp
new InlineToolSchema(ToolDefinition[] schema)
go
NewInlineToolSchema(Schema *[]ToolDefinition)

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.

s3Filemay be undefinedLocations3_filemay be undefinedLocations3Filemay be undefinedLocationS3Filemay be undefinedLocationS3Filemay be undefinedLocation#
The S3 location of the tool schema file, if using an S3-based schema.

Contains the bucket name and object key information.

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 // chainable@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@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.
grantPermissionsToRole(_role: IRole): voiddef grant_permissions_to_role(self, _role: IRole) -> Nonepublic void grantPermissionsToRole(IRole _role)public void GrantPermissionsToRole(IRole _role)func GrantPermissionsToRole(_role IRole)#
Grant permissions to the role.