bedrock-agent¶
Since Docker image version 0.0.33
Amazon Bedrock Agent Interface.
This provider allows you to interact with Amazon Bedrock Agents through the Sample Connector for Bedrock. Bedrock Agents help you build AI applications that can perform tasks by connecting to your data sources and systems.
Configuration¶
Invoke Amazon Bedrock Agents via the Bedrock API. You can configure your Bedrock Agent with this provider.
Amazon Bedrock Agents documentation explains how to use Bedrock Agents and what features they support.
Note: This is currently a simple implementation for agent calling, which may be upgraded with additional features in future versions.
| Key | Type | Required | Default value | Description |
|---|---|---|---|---|
| region | string | Y | AWS region where your Bedrock Agent is deployed (e.g., “us-east-1”) | |
| agentId | string | Y | The ID of your Bedrock Agent | |
| agentAliasId | string | Y | The alias ID of your Bedrock Agent |
The configuration example:
Billing¶
The agent is invoked with its trace turned on, because the trace is where Bedrock reports the tokens of each model invocation. A call is billed for the sum of inputTokens and outputTokens over every step that invokes the model: pre-processing, orchestration, post-processing and the routing classifier. Input tokens are billed at price_in and output tokens at price_out of this model, on stream and non-stream calls. Only model tokens are billed, not what the agent’s action groups or knowledge bases cost.
The trace is read for billing only. It is not sent to the client and not logged.
Usage Example¶
Here’s an example of how to call a Bedrock Agent using the Sample Connector for Bedrock:
curl http://localhost:8866/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Session-Id: YOUR_SESSION_ID" \
-d '{
"model": "hr-agent",
"messages": [
{
"role": "user",
"content": "I don't know my ID"
}
]
}'
Note about Session-Id: You can generate a session ID when making the call. Just ensure you use a consistent value throughout your interaction session. It can be at most 128 characters; a longer one gets HTTP 400. In the current implementation, this provider only processes the latest user input, so there’s no need to include multiple conversation turns in your request.