Skip to content

Documentation / @agentick/openai / mapOpenAIChunk

Function: mapOpenAIChunk()

mapOpenAIChunk(chunk, toolCallIdByIndex): AdapterDelta | AdapterDelta[] | null

Defined in: openai.ts:53

Map an OpenAI streaming chunk to AdapterDelta(s). Extracted for testability — the id-tracking map is passed in.

Parameters

chunk

ChatCompletionChunk

toolCallIdByIndex

Map<number, string>

Returns

AdapterDelta | AdapterDelta[] | null

Released under the ISC License.