Skip to content
v2.275.0

Experimental

@aws-cdk/aws-bedrock-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

CustomOrchestrationExecutor Class ​

Contains details about the Lambda function containing the orchestration logic carried out upon invoking the custom orchestration.

Example ​

ts
const orchestrationFunction = new lambda.Function(this, 'OrchestrationFunction', {
  runtime: lambda.Runtime.PYTHON_3_10,
  handler: 'index.handler',
  code: lambda.Code.fromAsset('lambda/orchestration'),
});

const agent = new bedrock.Agent(this, 'CustomOrchestrationAgent', {
  instruction: 'You are a helpful assistant with custom orchestration logic.',
  foundationModel: bedrock.BedrockFoundationModel.AMAZON_NOVA_LITE_V1,
  customOrchestrationExecutor: bedrock.CustomOrchestrationExecutor.fromLambda(orchestrationFunction),
});

Properties ​

lambdaFunctionIFunctionlambda_functionIFunctionlambdaFunctionIFunctionLambdaFunctionIFunctionLambdaFunctionIFunction#
The Lambda function that contains the custom orchestration logic.

This function is called when the agent needs to make decisions about action execution.

The type of orchestration this executor performs.

Methods ​

fromLambda(lambdaFunction: IFunction): CustomOrchestrationExecutor // chainable@staticmethod def from_lambda(lambda_function: IFunction) -> CustomOrchestrationExecutorpublic static CustomOrchestrationExecutor fromLambda(IFunction lambdaFunction)public static CustomOrchestrationExecutor FromLambda(IFunction lambdaFunction)func FromLambda(LambdaFunction IFunction) CustomOrchestrationExecutorstatic#
Defines an orchestration executor with a Lambda function containing the business logic.
1 parameter

Parameters

  • lambdaFunctionlambda_functionlambdaFunctionlambdaFunctionLambdaFunction — - Lambda function to be called by the orchestration.