Skip to content
1 min read · 146 words

Function: buildConverseRequest()

ts
function buildConverseRequest(
  input: ConverseRequestBuildInput,
): Promise<ConverseRequest>;

Defined in: src/batteries/llm/bedrock_converse/helpers.ts:305

Assemble the native Converse request from ADK turn state. THE ordering seam.

Parameters

ParameterType
inputConverseRequestBuildInput

Returns

Promise<ConverseRequest>

Remarks

The translation that makes this battery different from pointing openai_chat_completions at a Converse-backed gateway:

  • System text becomes a top-level system[], never a turn.
  • A ToolCall becomes an assistant turn with a {toolUse} block, then a user turn with a {toolResult} block — Converse has no tool role.
  • Blocks accumulate on the CURRENT turn where possible, so prose and a tool call emitted in the same assistant turn stay in one turn (the shape Converse is designed around).
  • Alternation is applied last, under ConverseRequestBuildInput.alternationPolicy.
  • Timeline order is createdAt, matching the ordering guard's view, so what the guard validated is what gets dispatched.