Interface FunctionSchemaProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
FunctionSchemaProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)",
date="2025-11-17T14:41:04.480Z")
@Stability(Experimental)
public interface FunctionSchemaProps
extends software.amazon.jsii.JsiiSerializable
(experimental) Properties for a function schema.
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();
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forFunctionSchemaPropsstatic final classAn implementation forFunctionSchemaProps -
Method Summary
Modifier and TypeMethodDescriptionstatic FunctionSchemaProps.Builderbuilder()(experimental) Functions defined in the schema.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getFunctions
(experimental) Functions defined in the schema. -
builder
- Returns:
- a
FunctionSchemaProps.BuilderofFunctionSchemaProps
-