/** * Responses API adapter for the OpenAI model provider. * * Built-in tool support status: * | Tool | Support | * |-------------------|----------------------------------------------------------| * | web_search | Full: includes URL citations | * | file_search | Partial: works but file citation annotations not emitted | * | code_interpreter | Partial: works but executed code/stdout not surfaced | * | mcp | Partial: works but approval flow not supported | * | shell | Partial: container mode only | * | image_generation | Not supported | * * @internal */ import type { ResponseStreamEvent, ResponseCreateParamsStreaming } from 'openai/resources/responses/responses'; import type { Message, StopReason } from '../../types/messages.js'; import type { StateStore } from '../../state-store.js'; import type { ModelStreamEvent } from '../streaming.js'; import type { StreamOptions } from '../model.js'; import type { OpenAIResponsesConfig } from './types.js'; export declare const DEFAULT_RESPONSES_MODEL_ID: "gpt-5.4"; /** * Logs a warning for each responses-managed key present in `params`. * * @internal */ export declare function warnManagedParams(params: Record | undefined): void; /** * Builds a Responses API streaming request body. * * @internal */ export declare function formatResponsesRequest(config: OpenAIResponsesConfig, messages: Message[], options: StreamOptions | undefined, stateful: boolean): ResponseCreateParamsStreaming; /** * Internal stream state for the Responses adapter. Tracks the active content * block kind so the adapter can emit stop/start events when content type * switches (text ↔ reasoning ↔ citations). * * @internal */ export interface ResponsesStreamState { dataType: string | null; toolCalls: Map; finalUsage: { inputTokens: number; outputTokens: number; totalTokens: number; cacheReadInputTokens?: number; } | null; stopReason: StopReason; } /** * Creates fresh stream state for a new Responses API stream. * * @internal */ export declare function createResponsesStreamState(): ResponsesStreamState; /** * Maps a single Responses API stream event to zero or more SDK events. Mutates * `state` and, when `stateful` is `true`, writes `responseId` into `modelState`. * * @internal */ export declare function mapResponsesEventToSDK(event: ResponseStreamEvent, state: ResponsesStreamState, stateful: boolean, modelState: StateStore | undefined): ModelStreamEvent[]; /** * Emits the terminal events for a Responses API stream: closes any open content * block, flushes accumulated tool calls, emits usage metadata, and finishes * with `modelMessageStopEvent`. * * @internal */ export declare function finalizeResponsesStream(state: ResponsesStreamState): ModelStreamEvent[]; //# sourceMappingURL=responses-adapter.d.ts.map