Skip to content
2 min read · 414 words

@nhtio/adk/batteries/llm/openai_chat_completions/types ​

TypeScript wire shapes, helper contracts, and option types for the Chat Completions battery.

Remarks ​

Shared TypeScript type aliases for the OpenAI Chat Completions 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 (openAIChatCompletionsOptionsSchema).

Interfaces ​

InterfaceDescription
AssembledToolCallAn assembled tool call ready for execution.
ChatCompletionsChunkStreaming chunk response from a chat completion API.
ChatCompletionsChunkChoiceA choice option in a streaming chat completions chunk.
ChatCompletionsChunkDeltaStream delta payload for a chat completion choice chunk.
ChatCompletionsHelpersFull translation-helper contract for the OpenAI Chat Completions battery.
ChatCompletionsMessageChat completion message wire object.
ChatCompletionsResponseNon-streaming chat completion response payload.
ChatCompletionsResponseChoiceA choice returned in non-streaming chat completions.
ChatCompletionsResponseMessageA message response in non-streaming chat completions.
ChatCompletionsToolCallDeltaPart of a tool call in a streaming response.
ChatCompletionsToolCallDeltaAccumulatorAccumulator for stitching together streaming tool call deltas into fully-assembled tool calls.
ChatCompletionsToolCallWireWire representation of a tool call in a chat completion response or request.
OpenAIChatCompletionsAdapterOptionsConfiguration options for the OpenAI Chat Completions adapter.
OpenAIChatCompletionsRequestBodyRequest body structure for the OpenAI Chat Completions API.
ReasoningExtractA single reasoning trace extracted from a response message or stream delta — the wire field it came from and its content. Returned by extractReasoningFields.

Type Aliases ​

Type AliasDescription
ChatCompletionsContentBlockDiscriminated union of content block shapes accepted by the OpenAI Chat Completions wire format for a content-array message body.
ReasoningFieldA wire field name that may carry model reasoning/thinking output on an OpenAI-compatible Chat Completions response.
ReasoningFieldPrecedenceOrdered precedence list of reasoning wire fields. See OpenAIChatCompletionsAdapterOptions.reasoningFieldPrecedence.

References ​

ChatCompletionsBucketLabel ​

Re-exports ChatCompletionsBucketLabel


ChatCompletionsBucketOrder ​

Re-exports ChatCompletionsBucketOrder


ChatCompletionsRetryConfig ​

Re-exports ChatCompletionsRetryConfig


ChatCompletionsTool ​

Re-exports ChatCompletionsTool


DescriptionLike ​

Re-exports DescriptionLike


JsonSchema ​

Re-exports JsonSchema


MemoryAttrs ​

Re-exports MemoryAttrs


RetrievableAttrs ​

Re-exports RetrievableAttrs


StandingInstructionAttrs ​

Re-exports StandingInstructionAttrs


ThoughtAttrs ​

Re-exports ThoughtAttrs


ToolCallIdFilterFn ​

Re-exports ToolCallIdFilterFn


ToolCallParserFn ​

Re-exports ToolCallParserFn


ToolCallParserName ​

Re-exports ToolCallParserName


TrustedContentAttrs ​

Re-exports TrustedContentAttrs


UnsupportedMediaPolicy ​

Re-exports UnsupportedMediaPolicy


UntrustedContentAttrs ​

Re-exports UntrustedContentAttrs