Amazon Bedrock
Updated
Integrate Amazon Bedrock LLMs with the Conversational AI Engine.
Amazon Bedrock provides access to a variety of foundation models (FMs) from leading AI providers through a fully managed AWS service.
Sample configuration
The following example shows how to configure Amazon Bedrock LLM when starting a conversational AI agent.
from agora_agent import Agent, AmazonBedrock
# client is your configured Agora client
agent = (
Agent(client)
.with_stt(...) # configure your STT vendor
.with_llm(AmazonBedrock(
access_key='your-aws-access-key-id',
secret_key='your-aws-secret-access-key',
region='us-east-1',
model='us.anthropic.claude-sonnet-4-20250514-v1:0',
system_messages=[{'role': 'system', 'content': 'You are a helpful chatbot.'}],
))
.with_tts(...) # configure your TTS vendor
)import { Agent, AmazonBedrock } from 'agora-agents';
// client is your configured Agora client
const agent = new Agent({ client })
.withStt(/* configure your STT vendor */)
.withLlm(new AmazonBedrock({
accessKey: 'your-aws-access-key-id',
secretKey: 'your-aws-secret-access-key',
region: 'us-east-1',
model: 'us.anthropic.claude-sonnet-4-20250514-v1:0',
systemMessages: [{ role: 'system', content: 'You are a helpful chatbot.' }],
}))
.withTts(/* configure your TTS vendor */);import (
"github.com/AgoraIO/agora-agents-go/v2/agentkit"
"github.com/AgoraIO/agora-agents-go/v2/agentkit/vendors"
)
// client is your configured Agora client
agent := agentkit.NewAgent(client).WithStt(/* configure your STT vendor */).
WithLlm(
vendors.NewAmazonBedrock(vendors.AmazonBedrockOptions{
AccessKey: "your-aws-access-key-id",
SecretKey: "your-aws-secret-access-key",
Region: "us-east-1",
Model: "us.anthropic.claude-sonnet-4-20250514-v1:0",
SystemMessages: []map[string]interface{}{
{"role": "system", "content": "You are a helpful chatbot."},
},
}),
).WithTts(/* configure your TTS vendor */)Use the following llm configuration in your request:
"llm": {
"url": "https://bedrock-runtime.us-east-1.amazonaws.com/model/us.anthropic.claude-sonnet-4-20250514-v1:0/converse-stream",
"api_key": "<your_bedrock_api_key>",
"access_key": "<your_aws_access_key_id>",
"secret_key": "<your_aws_secret_access_key>",
"region": "us-east-1",
"model": "us.anthropic.claude-sonnet-4-20250514-v1:0",
"system_messages": [
{
"role": "system",
"content": "You are a helpful chatbot."
}
],
"style": "bedrock"
}Key parameters
| Parameter | Description |
|---|---|
urlstring | The Amazon Bedrock runtime endpoint for the target region and model. See Amazon Bedrock endpoints and quotas for the correct endpoint format. |
api_keystring | Your Bedrock API key for authentication. Use either |
access_keystring | Your AWS Access Key ID for authenticating Bedrock API calls. Required if not using |
secret_keystring | Your AWS Secret Access Key for authenticating Bedrock API calls. Required if not using |
regionstring | The AWS region hosting the Bedrock model, for example, |
stylestring | The API style to use. Set to |
For advanced configuration options, model capabilities, and detailed parameter descriptions, see the Amazon Bedrock documentation.
