Skip to content
1 min read · 95 words

Function: normalizeOpenAIResponsesItemId()

ts
function normalizeOpenAIResponsesItemId(id: string, prefix?: string): string;

Defined in: src/batteries/llm/openai_responses/helpers.ts:1190

Normalises an ADK-authored id to the Responses item-id charset, and hashes+truncates ids over the 64-character limit (Known Gotcha #5) rather than sending an oversized id verbatim.

Parameters

ParameterTypeDefault value
idstringundefined
prefixstring'msg'

Returns

string

Remarks

Not part of the public OpenAIResponsesHelpers contract (no override seam is warranted for a pure charset/length transform) — exported for the adapter and for direct unit testing.