ReqLLM.Providers.AmazonBedrock.Response (ReqLLM v1.0.0)
View SourceShared utilities for unwrapping AWS Bedrock response formats.
Bedrock wraps provider responses in AWS-specific formats (base64 encoding, event streams). This module handles the Bedrock-specific unwrapping so provider modules can work with native provider formats.
Summary
Functions
Unwraps a Bedrock streaming chunk into the underlying provider event format.
Types
@type t() :: %ReqLLM.Providers.AmazonBedrock.Response{payload: term()}
Functions
Unwraps a Bedrock streaming chunk into the underlying provider event format.
Bedrock can wrap events in several formats:
%{"chunk" => %{"bytes" => base64}}- AWS SDK format (Anthropic)%{"bytes" => base64}- Direct bytes format%{"type" => ...}- Anthropic JSON event (already decoded)%{"object" => ...}- OpenAI JSON event (already decoded)%{"generation" => ...}- Meta Llama JSON event (already decoded)
Returns the unwrapped event as a map, or an error tuple.