Class: OpenAIResponsesAdapter
Defined in: src/batteries/llm/openai_responses/adapter.ts:380
Opinionated cross-environment LLM adapter for the OpenAI Responses wire shape.
Remarks
Construction validates options eagerly via validateOptions and throws E_INVALID_OPENAI_RESPONSES_OPTIONS on failure. The returned instance is reusable: call OpenAIResponsesAdapter.executor once per DispatchRunner configuration.
Per-iteration overrides live on the active DispatchContext's stash.openaiResponses slot and take highest precedence — they merge into the executor-scope shape on every iteration. headers, helpers, and retry merge key-by-key across all three layers; every other field is replaced wholesale at the highest layer that sets it.
Constructors
Constructor
new OpenAIResponsesAdapter(options: unknown): OpenAIResponsesAdapter;Defined in: src/batteries/llm/openai_responses/adapter.ts:396
Parameters
| Parameter | Type | Description |
|---|---|---|
options | unknown | Constructor-baseline options. Re-validated on every iteration after per-dispatch and per-iteration overrides are layered in. |
Returns
OpenAIResponsesAdapter
Throws
E_INVALID_OPENAI_RESPONSES_OPTIONS when options does not satisfy openAIResponsesOptionsSchema.
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
STASH_KEY | readonly | "openaiResponses" | Customary key for per-iteration overrides on ctx.stash. The adapter reads ctx.stash.get(OpenAIResponsesAdapter.STASH_KEY, {}) at the start of every iteration and merges the value into the resolved options shape. | src/batteries/llm/openai_responses/adapter.ts:386 |
Methods
executor()
executor(overrides?: Partial<OpenAIResponsesAdapterOptions>): DispatchExecutorFn;Defined in: src/batteries/llm/openai_responses/adapter.ts:409
Returns a DispatchExecutorFn bound to this adapter's baseline plus optional executor-scope overrides. The returned function is reusable across iterations — every iteration re-merges with ctx.stash[STASH_KEY] and re-validates the result.
Parameters
| Parameter | Type | Description |
|---|---|---|
overrides? | Partial<OpenAIResponsesAdapterOptions> | Optional executor-scope overrides. Higher precedence than the baseline, lower precedence than ctx.stash[STASH_KEY]. |
Returns
A DispatchExecutorFn suitable for DispatchRunner.
isOpenAIResponsesAdapter()
static isOpenAIResponsesAdapter(value: unknown): value is OpenAIResponsesAdapter;Defined in: src/batteries/llm/openai_responses/adapter.ts:1972
Returns true when value is an OpenAIResponsesAdapter instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | unknown | The value to test. |
Returns
value is OpenAIResponsesAdapter
true when value is an OpenAIResponsesAdapter instance.