Skip to main content
Factory function to create an AWS Bedrock model instance using the Converse API.
Requires optional dependency: pip install ai-query[bedrock]

Signature

Parameters

str
required
The Bedrock model ID (e.g., “anthropic.claude-3-5-sonnet-20241022-v2:0”).
str
AWS region. Falls back to AWS_REGION or AWS_DEFAULT_REGION environment variable.
dict | Callable
AWS credentials. Can be:
  • None: Use default AWS credential chain
  • dict: {"access_key": "...", "secret_key": "...", "session_token": "..."}
  • Callable: A credentials provider function

Returns

A LanguageModel instance configured for AWS Bedrock.

Environment

Uses the standard AWS credential chain. Optionally set:

Available Models

Example

With Credentials