import type { Capabilities, Request, StreamEvent } from '@wrongstack/core/types'; import { ProviderError } from '@wrongstack/core/types'; import { type HeadersLike } from './error-parse.js'; import { type BuildBodyContext } from './model-output-limits.js'; import { parseSSE } from './sse.js'; import { type ConvertOptions } from './tool-format/to-openai.js'; import { WireAdapter, type WireAdapterStreamOptions } from './wire-adapter.js'; export interface OpenAIProviderOptions { apiKey: string; baseUrl?: string | undefined; organization?: string | undefined; fetchImpl?: typeof fetch | undefined; quirks?: (ConvertOptions & { parallelToolsDisabled?: boolean | undefined; thinkingParam?: 'zai-glm' | 'kimi-toggle' | 'always-on' | undefined; stripThinkTags?: boolean | undefined; maxTools?: number | undefined; tolerateMissingTerminalMarker?: boolean | undefined; }) | undefined; id?: string | undefined; capabilities?: Partial | undefined; /** Raw stream debugging and hang-detection options. */ streamOpts?: WireAdapterStreamOptions | undefined; } export declare class OpenAIProvider extends WireAdapter { readonly id: string; readonly capabilities: Capabilities; protected readonly opts: OpenAIProviderOptions; constructor(opts: OpenAIProviderOptions); protected buildUrl(_req: Request): string; protected buildHeaders(req: Request): Record; /** * The request field used to cap output length. Real OpenAI deprecated * `max_tokens` and the newer model families (gpt-4o, o1/o3/o4) 400 on it — * they require `max_completion_tokens`. OpenAI-compatible endpoints that * still only accept `max_tokens` override this. See issue #10. */ protected tokenLimitParam(): string; protected buildBody(req: Request, ctx: BuildBodyContext): Record; protected parseStream(body: Parameters[0], fallbackModel: string): AsyncIterable; protected translateError(status: number, text: string, headers?: HeadersLike): ProviderError; private stripCacheControl; } //# sourceMappingURL=openai.d.ts.map