Skip to content
v2.276.0

ToolConfigurationProperty Struct ​

Configuration information for the tools that you pass to a model.

For more information, see Tool use (function calling) in the Amazon Bedrock User Guide.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_bedrock as bedrock } from 'aws-cdk-lib';

declare const any: any;
declare const auto: any;
declare const json: any;
const toolConfigurationProperty: bedrock.CfnPromptVersion.ToolConfigurationProperty = {
  tools: [{
    cachePoint: {
      type: 'type',
    },
    toolSpec: {
      inputSchema: {
        json: json,
      },
      name: 'name',

      // the properties below are optional
      description: 'description',
    },
  }],

  // the properties below are optional
  toolChoice: {
    any: any,
    auto: auto,
    tool: {
      name: 'name',
    },
  },
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_bedrock as bedrock

# any: Any
# auto: Any
# json: Any

tool_configuration_property = bedrock.CfnPromptVersion.ToolConfigurationProperty(
    tools=[bedrock.CfnPromptVersion.ToolProperty(
        cache_point=bedrock.CfnPromptVersion.CachePointBlockProperty(
            type="type"
        ),
        tool_spec=bedrock.CfnPromptVersion.ToolSpecificationProperty(
            input_schema=bedrock.CfnPromptVersion.ToolInputSchemaProperty(
                json=json
            ),
            name="name",

            # the properties below are optional
            description="description"
        )
    )],

    # the properties below are optional
    tool_choice=bedrock.CfnPromptVersion.ToolChoiceProperty(
        any=any,
        auto=auto,
        tool=bedrock.CfnPromptVersion.SpecificToolChoiceProperty(
            name="name"
        )
    )
)
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.*;

Object any;
Object auto;
Object json;

ToolConfigurationProperty toolConfigurationProperty = ToolConfigurationProperty.builder()
        .tools(List.of(ToolProperty.builder()
                .cachePoint(CachePointBlockProperty.builder()
                        .type("type")
                        .build())
                .toolSpec(ToolSpecificationProperty.builder()
                        .inputSchema(ToolInputSchemaProperty.builder()
                                .json(json)
                                .build())
                        .name("name")

                        // the properties below are optional
                        .description("description")
                        .build())
                .build()))

        // the properties below are optional
        .toolChoice(ToolChoiceProperty.builder()
                .any(any)
                .auto(auto)
                .tool(SpecificToolChoiceProperty.builder()
                        .name("name")
                        .build())
                .build())
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Bedrock;

var any;
var auto;
var json;

var toolConfigurationProperty = new ToolConfigurationProperty {
    Tools = new [] { new ToolProperty {
        CachePoint = new CachePointBlockProperty {
            Type = "type"
        },
        ToolSpec = new ToolSpecificationProperty {
            InputSchema = new ToolInputSchemaProperty {
                Json = json
            },
            Name = "name",

            // the properties below are optional
            Description = "description"
        }
    } },

    // the properties below are optional
    ToolChoice = new ToolChoiceProperty {
        Any = any,
        Auto = auto,
        Tool = new SpecificToolChoiceProperty {
            Name = "name"
        }
    }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/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/awscdk"

var any interface{}
var auto interface{}
var json interface{}

toolConfigurationProperty := &ToolConfigurationProperty{
	Tools: []interface{}{
		&ToolProperty{
			CachePoint: &CachePointBlockProperty{
				Type: jsii.String("type"),
			},
			ToolSpec: &ToolSpecificationProperty{
				InputSchema: &ToolInputSchemaProperty{
					Json: json,
				},
				Name: jsii.String("name"),

				// the properties below are optional
				Description: jsii.String("description"),
			},
		},
	},

	// the properties below are optional
	ToolChoice: &ToolChoiceProperty{
		Any: any,
		Auto: auto,
		Tool: &SpecificToolChoiceProperty{
			Name: jsii.String("name"),
		},
	},
}

Properties ​

toolChoiceoptionalIResolvable | CfnPromptVersion.ToolChoicePropertytool_choiceoptionaltyping.Union[IResolvable, ToolChoiceProperty]toolChoiceoptionalIResolvableToolChoiceoptionalIResolvableToolChoiceoptionalinterface{}#
If supported by model, forces the model to request a tool.
toolsIResolvable | IResolvable | CfnPromptVersion.ToolProperty[]toolstyping.Union[IResolvable, typing.List[typing.Union[IResolvable, ToolProperty]]]toolsIResolvableToolsIResolvableToolsinterface{}required#
An array of tools that you want to pass to a model.