@nhtio/adk/batteries/llm/openai_responses/types
TypeScript wire shapes, helper contracts, and option types for the OpenAI Responses battery.
Remarks
Type aliases for the OpenAI Responses adapter — wire shapes, helper input/output shapes, and the adapter's options shape. These are documentation-level types only; runtime validation lives in validation.ts (openAIResponsesOptionsSchema).
The Responses API replaces the flat messages[] array with a flat input: Item[] array — a tool call and its result are two SIBLING top-level items, not one message containing both. The system prompt lives in a top-level instructions string field by default (or, via systemPromptChannel, a leading developer/system-role item instead).
Interfaces
| Interface | Description |
|---|---|
| OpenAIResponsesAdapterOptions | Configuration options for the OpenAI Responses adapter. |
| OpenAIResponsesCompletedEvent | Terminal SSE event emitted when the response completes successfully. |
| OpenAIResponsesErrorEvent | Terminal SSE event emitted when the stream itself errors, outside of any particular response object. |
| OpenAIResponsesFailedEvent | Terminal SSE event emitted when the response fails outright. |
| OpenAIResponsesFunctionCallArgumentsDeltaEvent | SSE event emitted when a fragment of a tool call's JSON arguments streams in. |
| OpenAIResponsesFunctionCallArgumentsDoneEvent | SSE event emitted when a tool call's JSON arguments string is finalized. |
| OpenAIResponsesFunctionCallItem | A model-emitted function (tool) call item. |
| OpenAIResponsesFunctionCallOutputItem | The result of executing a function_call_output's paired function_call. |
| OpenAIResponsesHelpers | Full translation-helper contract for the OpenAI Responses battery. |
| OpenAIResponsesIncompleteEvent | Terminal SSE event emitted when the response stops before completing (e.g. hit max_output_tokens). |
| OpenAIResponsesMessageItem | An input message item — the leading-content-channel item shape (role: 'user', or the leading developer/system-role item rendered when systemPromptChannel is not 'instructions', or a trailing after-timeline bucket message), plus a peer-identity assistant timeline turn rendered as a plain input message rather than the full output-item shape. |
| OpenAIResponsesOpaqueOutputItem | Any other output item type the Responses API can emit that this battery does not natively model (hosted server-side tools: web_search_call, code_interpreter_call, mcp_call, etc.). Carried through structurally so the streaming state machine can recognize — and deliberately decline to open a slot for — an item type it does not know, per Known Gotcha #6. |
| OpenAIResponsesOutputItemAddedEvent | SSE event emitted when a new output item is opened (streaming begins for that item). |
| OpenAIResponsesOutputItemDoneEvent | SSE event emitted when an output item is finalized — its terminal, fully-populated shape. |
| OpenAIResponsesOutputMessageItem | An assistant output-message item, in the OUTPUT shape (not the input shape) — used when replaying the ADK's OWN prior assistant text back into input, so the reasoning-pairing validator (see the Known Gotchas) recognizes it correctly as a genuine prior output item. |
| OpenAIResponsesOutputTextDeltaEvent | SSE event emitted when a text fragment streams in for an output message's content. |
| OpenAIResponsesOutputTextDoneEvent | SSE event emitted when an output message's text content part is finalized. |
| OpenAIResponsesReasoningContentPart | One full-reasoning-text part of a reasoning item (present only under some include values). |
| OpenAIResponsesReasoningItem | A model-emitted reasoning item — the native wire representation of a "thought." Only ever sent back on input when reasoningReplay !== 'off' and its stored signature/prefix-fingerprint is still valid; see the reasoning-pairing adjacency-sweep pass and Known Gotcha #1. |
| OpenAIResponsesReasoningReplayPayload | Opaque payload stored on a replayable OpenAI Responses reasoning Thought. Sibling to the Anthropic battery's AnthropicThinkingReplayPayload. |
| OpenAIResponsesReasoningSummaryPart | One summary-text part of a reasoning item. |
| OpenAIResponsesReasoningSummaryTextDeltaEvent | SSE event emitted when a reasoning-summary text fragment streams in for a reasoning item. |
| OpenAIResponsesReasoningSummaryTextDoneEvent | SSE event emitted when a reasoning item's summary-text part is finalized. |
| OpenAIResponsesReasoningTextDeltaEvent | SSE event emitted when a full-reasoning text fragment streams in for a reasoning item. |
| OpenAIResponsesReasoningTextDoneEvent | SSE event emitted when a reasoning item's full-reasoning-text part is finalized. |
| OpenAIResponsesRefusalDeltaEvent | SSE event emitted when a refusal fragment streams in for an output message's content. |
| OpenAIResponsesRefusalDoneEvent | SSE event emitted when an output message's refusal content part is finalized. |
| OpenAIResponsesRequestBody | The WIRE body shape this battery constructs and sends — not a 1:1 mirror of consumer-settable options. instructions and store are ALWAYS adapter-computed; neither is a key on OpenAIResponsesAdapterOptions. |
| OpenAIResponsesResponseObject | The full response object — returned directly (non-streaming), or nested under a terminal streaming event. |
| OpenAIResponsesUsage | Token-usage accounting on a Responses response object. |
| ResponsesOutputSlotMachine | Per-dispatch streaming-state accumulator, keyed by output_index (one slot per output item — NOT a tool-call index, unlike Chat Completions). Constructed fresh per generation via OpenAIResponsesHelpers.createResponsesOutputSlotMachine. |
| ResponsesTextSlot | A streaming text (assistant output-message) slot. |
| ResponsesThinkingSlot | A streaming reasoning ("thinking") slot. |
| ResponsesToolCallSlot | A streaming tool-call slot. |
Type Aliases
| Type Alias | Description |
|---|---|
| OpenAIResponsesIncludable | Value(s) requestable via the wire include array. |
| OpenAIResponsesInputContentBlock | Discriminated union of content block shapes accepted by the OpenAI Responses input item content array (and, per the API reference, also the shape a function_call_output.output array entry may take). |
| OpenAIResponsesInputItem | Discriminated union of every item shape this battery sends on the input array. |
| OpenAIResponsesOutputItem | Discriminated union of every item shape the Responses API can emit in response.output. |
| OpenAIResponsesOutputMessageContentPart | One output-message content part. |
| OpenAIResponsesStreamEvent | Discriminated union of every streaming event this battery handles explicitly, plus a structural fallback ({type: string, ...}) for the many other event types the Responses API emits (response.created, response.in_progress, response.content_part.added/.done, hosted-tool progress events, etc.) that this battery does not act on. |
| OpenAIResponsesTool | Wire shape of a single function tool advertised to the model. name is TOP-LEVEL, unlike Chat Completions' {type:'function', function:{name, ...}} nesting. |
| OpenAIResponsesToolChoice | Tool-choice directive accepted by this battery's v1 (a subset of the full wire union). |
| ReasoningReplayMode | Reasoning-replay mode. See OpenAIResponsesAdapterOptions.reasoningReplay. |
| ResponsesOutputSlot | Union of every tracked per-output_index slot kind. |
| SystemPromptChannel | Channel the ADK-rendered system prompt is placed on. See OpenAIResponsesAdapterOptions.systemPromptChannel. |
References
ChatCompletionsBucketLabel
Re-exports ChatCompletionsBucketLabel
ChatCompletionsBucketOrder
Re-exports ChatCompletionsBucketOrder
ChatCompletionsRetryConfig
Re-exports ChatCompletionsRetryConfig
ChatHelpersCommon
Re-exports ChatHelpersCommon
DescriptionLike
Re-exports DescriptionLike
JsonSchema
Re-exports JsonSchema
MemoryAttrs
Re-exports MemoryAttrs
RetrievableAttrs
Re-exports RetrievableAttrs
StandingInstructionAttrs
Re-exports StandingInstructionAttrs
ThoughtAttrs
Re-exports ThoughtAttrs
ToolCallParserFn
Re-exports ToolCallParserFn
ToolCallParserName
Re-exports ToolCallParserName
TrustedContentAttrs
Re-exports TrustedContentAttrs
UnsupportedMediaPolicy
Re-exports UnsupportedMediaPolicy
UntrustedContentAttrs
Re-exports UntrustedContentAttrs