Skip to content
1 min read · 215 words

@nhtio/adk/batteries/llm/bedrock_converse/adapter

Cross-environment executor adapter for AWS Bedrock's native Converse API.

Remarks

Targets POST {baseURL}/model/{modelId}/converse (and /converse-stream when stream is set) over plain HTTPS with a Bedrock API key (Authorization: Bearer ABSK…). Deliberately NO AWS SDK and no SigV4 signer: the battery must stay cross-environment and dependency-light, and a bearer key removes the only reason to pull in a signer.

Why a native battery rather than pointing openai_chat_completions at a Converse-backed gateway: Converse is a content-BLOCK protocol with strict role alternation, a required toolConfig whenever tool blocks appear, and tool results carried on user turns. A gateway must repair all of that on your behalf — most notably by MERGING consecutive same-role turns — and that repair is invisible in the response. For ordinary use it is fine; for anything that needs to know what the VENDOR received it is fatal, because a gateway's fix is indistinguishable from vendor tolerance. See the validation battery's "Which API surface a rule applies to" guide, and BedrockConverseAdapterOptions.alternationPolicy for the 'reject' escape hatch that lets Converse's own error surface.

Options layer as in every other battery: constructor baseline → executor() overrides → per-iteration ctx.stash.bedrockConverse, re-validated each iteration.

Classes

ClassDescription
BedrockConverseAdapterNative Bedrock Converse executor adapter.