interface FunctionSchemaProps
| Language | Type name | 
|---|---|
|  .NET | Amazon.CDK.AWS.Bedrock.Alpha.FunctionSchemaProps | 
|  Go | github.com/aws/aws-cdk-go/awsbedrockalpha/v2#FunctionSchemaProps | 
|  Java | software.amazon.awscdk.services.bedrock.alpha.FunctionSchemaProps | 
|  Python | aws_cdk.aws_bedrock_alpha.FunctionSchemaProps | 
|  TypeScript (source) | @aws-cdk/aws-bedrock-alpha»FunctionSchemaProps | 
Properties for a function schema.
Example
const actionGroupFunction = new lambda.Function(this, 'ActionGroupFunction', {
  runtime: lambda.Runtime.PYTHON_3_12,
  handler: 'index.handler',
  code: lambda.Code.fromAsset(path.join(__dirname, '../lambda/action-group')),
});
// Define a function schema with parameters
const functionSchema = new bedrock.FunctionSchema({
  functions: [
    {
      name: 'searchBooks',
      description: 'Search for books in the library catalog',
      parameters: {
        'query': {
          type: bedrock.ParameterType.STRING,
          required: true,
          description: 'The search query string',
        },
        'maxResults': {
          type: bedrock.ParameterType.INTEGER,
          required: false,
          description: 'Maximum number of results to return',
        },
        'includeOutOfPrint': {
          type: bedrock.ParameterType.BOOLEAN,
          required: false,
          description: 'Whether to include out-of-print books',
        }
      },
      requireConfirmation: bedrock.RequireConfirmation.DISABLED,
    },
    {
      name: 'getBookDetails',
      description: 'Get detailed information about a specific book',
      parameters: {
        'bookId': {
          type: bedrock.ParameterType.STRING,
          required: true,
          description: 'The unique identifier of the book',
        }
      },
      requireConfirmation: bedrock.RequireConfirmation.ENABLED,
    }
  ]
});
// Create an action group using the function schema
const actionGroup = new bedrock.AgentActionGroup({
  name: 'library-functions',
  description: 'Functions for interacting with the library catalog',
  executor: bedrock.ActionGroupExecutor.fromLambda(actionGroupFunction),
  functionSchema: functionSchema,
  enabled: true,
});
const agent = new bedrock.Agent(this, 'Agent', {
  foundationModel: bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_HAIKU_V1_0,
  instruction: 'You are a helpful and friendly agent that answers questions about literature.',
  actionGroups: [actionGroup],
});
Properties
| Name | Type | Description | 
|---|---|---|
| functions | Function[] | Functions defined in the schema. | 
functions
Type:
Function[]
Functions defined in the schema.
