Interface ToolConfiguration

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
ToolConfiguration.Jsii$Proxy

@Generated(value="jsii-pacmak/1.112.0 (build de1bc80)", date="2025-07-29T17:51:11.518Z") @Stability(Experimental) public interface ToolConfiguration extends software.amazon.jsii.JsiiSerializable
(experimental) Configuration for tools available to the model.

Example:

 Key cmk = Key.Builder.create(this, "cmk").build();
 IPromptVariant variantChat = PromptVariant.chat(ChatPromptVariantProps.builder()
         .variantName("variant1")
         .model(BedrockFoundationModel.ANTHROPIC_CLAUDE_3_5_SONNET_V1_0)
         .messages(List.of(ChatMessage.user("From now on, you speak Japanese!"), ChatMessage.assistant("Konnichiwa!"), ChatMessage.user("From now on, you speak {{language}}!")))
         .system("You are a helpful assistant that only speaks the language you`re told.")
         .promptVariables(List.of("language"))
         .toolConfiguration(ToolConfiguration.builder()
                 .toolChoice(ToolChoice.AUTO)
                 .tools(List.of(Tool.function(FunctionToolProps.builder()
                         .name("top_song")
                         .description("Get the most popular song played on a radio station.")
                         .inputSchema(Map.of(
                                 "type", "object",
                                 "properties", Map.of(
                                         "sign", Map.of(
                                                 "type", "string",
                                                 "description", "The call sign for the radio station for which you want the most popular song. Example calls signs are WZPZ and WKR.")),
                                 "required", List.of("sign")))
                         .build())))
                 .build())
         .build());
 Prompt.Builder.create(this, "prompt1")
         .promptName("prompt-chat")
         .description("my first chat prompt")
         .defaultVariant(variantChat)
         .variants(List.of(variantChat))
         .kmsKey(cmk)
         .build();