Interface FunctionToolProps

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

@Generated(value="jsii-pacmak/1.112.0 (build de1bc80)", date="2025-07-24T11:33:25.543Z") @Stability(Experimental) public interface FunctionToolProps extends software.amazon.jsii.JsiiSerializable
(experimental) Properties for creating a function tool.

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();
 
  • Method Details

    • getDescription

      @Stability(Experimental) @NotNull String getDescription()
      (experimental) A description of what the function does.
    • getInputSchema

      @Stability(Experimental) @NotNull Object getInputSchema()
      (experimental) The input schema for the function parameters.
    • getName

      @Stability(Experimental) @NotNull String getName()
      (experimental) The name of the function.
    • builder

      @Stability(Experimental) static FunctionToolProps.Builder builder()
      Returns:
      a FunctionToolProps.Builder of FunctionToolProps