Class BedrockCodec

  • All Implemented Interfaces:
    ProviderCodec

    public class BedrockCodec
    extends Object
    implements ProviderCodec
    Codec for AWS Bedrock (Anthropic-on-Bedrock) invokeModel API (version bedrock-2023-05-31).

    This codec targets the plain Anthropic body wire format used by Bedrock's invokeModel endpoint for Anthropic Claude models. The request and response shapes are essentially identical to native Anthropic Messages API — the key difference is the model identifier format and URL path.

    Limitation: Bedrock's InvokeModelWithResponseStream wraps each SSE chunk in a binary {"chunk":{"bytes":"..."}} envelope. This codec does not implement that binary chunk-wrapping framing, emitting instead the plain Anthropic SSE event stream. This is sufficient for most testing scenarios where the Bedrock SDK is configured to auto-decode the envelope, or where tests mock at the HTTP layer after SDK decoding.