Experimental
@aws-cdk/aws-bedrock-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
AgentStepType Enum
The step in the agent sequence that this prompt configuration applies to.
| Stability | Experimental |
|---|---|
| Source | bedrock/agents/prompt-override.ts |
Example
ts
const agent = new bedrock.Agent(this, 'Agent', {
foundationModel: bedrock.BedrockFoundationModel.AMAZON_NOVA_LITE_V1,
instruction: 'You are a helpful assistant.',
promptOverrideConfiguration: bedrock.PromptOverrideConfiguration.fromSteps([
{
stepType: bedrock.AgentStepType.ROUTING_CLASSIFIER,
stepEnabled: true,
customPromptTemplate: 'Your routing template here',
foundationModel: bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_V2
} as bedrock.PromptRoutingClassifierConfigCustomParser
])
});
python
agent = bedrock.Agent(self, "Agent",
foundation_model=bedrock.BedrockFoundationModel.AMAZON_NOVA_LITE_V1,
instruction="You are a helpful assistant.",
prompt_override_configuration=bedrock.PromptOverrideConfiguration.from_steps([
step_type=bedrock.AgentStepType.ROUTING_CLASSIFIER,
step_enabled=True,
custom_prompt_template="Your routing template here",
foundation_model=bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_V2
])
)
java
Agent agent = Agent.Builder.create(this, "Agent")
.foundationModel(BedrockFoundationModel.AMAZON_NOVA_LITE_V1)
.instruction("You are a helpful assistant.")
.promptOverrideConfiguration(PromptOverrideConfiguration.fromSteps(List.of((PromptRoutingClassifierConfigCustomParser)PromptRoutingClassifierConfigCustomParser.builder()
.stepType(AgentStepType.ROUTING_CLASSIFIER)
.stepEnabled(true)
.customPromptTemplate("Your routing template here")
.foundationModel(BedrockFoundationModel.ANTHROPIC_CLAUDE_V2)
.build())))
.build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.Bedrock.Alpha
var agent = new Agent(this, "Agent", new AgentProps {
FoundationModel = BedrockFoundationModel.AMAZON_NOVA_LITE_V1,
Instruction = "You are a helpful assistant.",
PromptOverrideConfiguration = PromptOverrideConfiguration.FromSteps(new [] { (PromptRoutingClassifierConfigCustomParser)new PromptRoutingClassifierConfigCustomParser {
StepType = AgentStepType.ROUTING_CLASSIFIER,
StepEnabled = true,
CustomPromptTemplate = "Your routing template here",
FoundationModel = BedrockFoundationModel.ANTHROPIC_CLAUDE_V2
} })
});
go
// Install: go get github.com/aws/aws-cdk-go/awsbedrockalpha/v2
agent := bedrock.NewAgent(this, jsii.String("Agent"), &AgentProps{
FoundationModel: bedrock.BedrockFoundationModel_AMAZON_NOVA_LITE_V1(),
Instruction: jsii.String("You are a helpful assistant."),
PromptOverrideConfiguration: bedrock.PromptOverrideConfiguration_FromSteps([]PromptStepConfigBase{
&PromptRoutingClassifierConfigCustomParser{
StepType: bedrock.AgentStepType_ROUTING_CLASSIFIER,
StepEnabled: jsii.Boolean(true),
CustomPromptTemplate: jsii.String("Your routing template here"),
FoundationModel: bedrock.BedrockFoundationModel_ANTHROPIC_CLAUDE_V2(),
}.(PromptRoutingClassifierConfigCustomParser),
}),
})
Members
| Member | Description |
|---|---|
PRE_PROCESSING | Pre-processing step that prepares the user input for orchestration. |
ORCHESTRATION | Main orchestration step that determines the agent's actions. |
POST_PROCESSING | Post-processing step that refines the agent's response. |
ROUTING_CLASSIFIER | Step that classifies and routes requests to appropriate collaborators. |
MEMORY_SUMMARIZATION | Step that summarizes conversation history for memory retention. |
KNOWLEDGE_BASE_RESPONSE_GENERATION | Step that generates responses using knowledge base content. |
Referenced by
PromptStepConfigBase.stepTypestep_typestepTypeStepTypeStepType