The AmazonBedrockAgent
is a specialized agent class in the Multi-Agent Orchestrator that integrates directly with Amazon Bedrock agents.
Creating an AmazonBedrockAgent
Here are various examples showing different ways to create and configure an AmazonBedrockAgent:
Python Package
If you haven’t already installed the AWS-related dependencies, make sure to install them:
Basic Examples
1. Minimal Configuration
2. Using Custom Client
3. With Tracing Enabled
4. With Streaming Enabled
5. Complete Example with All Options
Option Explanations
name
: (Required) Identifies the agent within your system.
description
: (Required) Describes the agent’s purpose or capabilities.
agentId/agent_id
: (Required) The ID of the Amazon Bedrock agent you want to use.
agentAliasId/agent_alias_id
: (Required) The alias ID of the Amazon Bedrock agent.
region
: (Optional) AWS region for the Bedrock service. If not provided, uses the default AWS region.
client
: (Optional) Custom BedrockAgentRuntimeClient for specialized configurations.
enableTrace/enable_trace
: (Optional) When set to true, enables tracing of the agent’s steps and reasoning process.
streaming
: (Optional) Enables streaming for the final response. Defaults to false.
Adding the Agent to the Orchestrator
To integrate the AmazonBedrockAgent into your Multi-Agent Orchestrator, follow these steps:
- First, ensure you have created an instance of the orchestrator:
- Then, add the agent to the orchestrator:
- Now you can use the orchestrator to route requests to the appropriate agent, including your Amazon Bedrock agent:
By leveraging the AmazonBedrockAgent
, you can easily integrate pre-built Amazon Bedrock agents into your Multi-Agent Orchestrator.