class

Autobot::Providers::BedrockProvider

Inherits Autobot::Providers::Provider < Reference < Object

AWS Bedrock provider using the Converse API with optional Guardrails.

Unlike HttpProvider, this uses AWS SigV4 authentication and a different request/response format (camelCase, union-key content blocks, nested configs).

Constants

CONNECT_TIMEOUT = 30.seconds
CONTENT_TYPE = "application/json"
Log = ::Log.for(self)
READ_TIMEOUT = 300.seconds
SERVICE_NAME = "bedrock"
STOP_REASON_MAP = {"end_turn" => "stop", "tool_use" => "tool_calls", "max_tokens" => "length", "stop_sequence" => "stop", "guardrail_intervened" => "guardrail_intervened", "content_filtered" => "content_filtered"}

Constructors

new(access_key_id : String, secret_access_key : String, region : String, model : String = "anthropic.claude-3-5-sonnet-20241022-v2:0", session_token : String | Nil = nil, guardrail_id : String | Nil = nil, guardrail_version : String | Nil = nil)
Source

Instance methods

chat(messages : Array(Hash(String, JSON::Any)), tools : Array(Hash(String, JSON::Any)) | Nil = nil, model : String | Nil = nil, max_tokens : Int32 = DEFAULT_MAX_TOKENS, temperature : Float64 = DEFAULT_TEMPERATURE) : Response
Source
default_model

The default model identifier for this provider.

Source
model
Source
region
Source