Interface FunctionParameterProps

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

@Generated(value="jsii-pacmak/1.112.0 (build de1bc80)", date="2025-07-16T11:43:25.127Z") @Stability(Experimental) public interface FunctionParameterProps extends software.amazon.jsii.JsiiSerializable
(experimental) Properties for a function parameter.

Example:

 Function actionGroupFunction = Function.Builder.create(this, "ActionGroupFunction")
         .runtime(Runtime.PYTHON_3_12)
         .handler("index.handler")
         .code(Code.fromAsset(join(__dirname, "../lambda/action-group")))
         .build();
 // Define a function schema with parameters
 FunctionSchema functionSchema = FunctionSchema.Builder.create()
         .functions(List.of(FunctionProps.builder()
                 .name("searchBooks")
                 .description("Search for books in the library catalog")
                 .parameters(Map.of(
                         "query", FunctionParameterProps.builder()
                                 .type(ParameterType.STRING)
                                 .required(true)
                                 .description("The search query string")
                                 .build(),
                         "maxResults", FunctionParameterProps.builder()
                                 .type(ParameterType.INTEGER)
                                 .required(false)
                                 .description("Maximum number of results to return")
                                 .build(),
                         "includeOutOfPrint", FunctionParameterProps.builder()
                                 .type(ParameterType.BOOLEAN)
                                 .required(false)
                                 .description("Whether to include out-of-print books")
                                 .build()))
                 .requireConfirmation(RequireConfirmation.DISABLED)
                 .build(), FunctionProps.builder()
                 .name("getBookDetails")
                 .description("Get detailed information about a specific book")
                 .parameters(Map.of(
                         "bookId", FunctionParameterProps.builder()
                                 .type(ParameterType.STRING)
                                 .required(true)
                                 .description("The unique identifier of the book")
                                 .build()))
                 .requireConfirmation(RequireConfirmation.ENABLED)
                 .build()))
         .build();
 // Create an action group using the function schema
 AgentActionGroup actionGroup = AgentActionGroup.Builder.create()
         .name("library-functions")
         .description("Functions for interacting with the library catalog")
         .executor(ActionGroupExecutor.fromLambda(actionGroupFunction))
         .functionSchema(functionSchema)
         .enabled(true)
         .build();
 Agent agent = Agent.Builder.create(this, "Agent")
         .foundationModel(BedrockFoundationModel.ANTHROPIC_CLAUDE_HAIKU_V1_0)
         .instruction("You are a helpful and friendly agent that answers questions about literature.")
         .actionGroups(List.of(actionGroup))
         .build();
 
  • Method Details

    • getType

      @Stability(Experimental) @NotNull ParameterType getType()
      (experimental) The type of the parameter.
    • getDescription

      @Stability(Experimental) @Nullable default String getDescription()
      (experimental) Description of the parameter.

      Default: undefined no description will be present

    • getRequired

      @Stability(Experimental) @Nullable default Boolean getRequired()
      (experimental) Whether the parameter is required.

      Default: true

    • builder

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