/** * ArkType schemas for the OpenAI chat-completions request shape we accept on the * gateway. Mirrors https://platform.openai.com/docs/api-reference/chat — only * the shapes the gateway translation layer understands. Unknown fields on * permissive objects are accepted-and-stripped (via `"+": "delete"`) so the * official OpenAI SDK — which sends a growing pile of non-strict defaults (e.g. * `stream_options.include_obfuscation`) — does not trip 400s on shapes we simply ignore. */ import type { ChatCompletionContentPart, ChatCompletionCreateParams, ChatCompletionMessageParam, ChatCompletionMessageToolCall, ChatCompletionTool, ChatCompletionToolChoiceOption } from "./openai-chat-wire"; export declare const textPartSchema: import("arktype/internal/variants/object.ts").ObjectType<{ type: "text"; text: string; }, {}>; /** * OpenAI documents `image_url` as either `{ url: string, detail?: ... }` or — * older clients — a bare string. Accept both shapes; downstream we extract a * URL. `detail` is accepted for forward-compat but currently dropped (pi-ai's * `ImageContent` has no detail field — TODO: plumb through if/when added). */ export declare const imagePartSchema: import("arktype/internal/variants/object.ts").ObjectType<{ type: "image_url"; image_url: string | { url: string; detail?: "auto" | "high" | "low" | undefined; }; }, {}>; /** OpenAI audio input block (gpt-4o-audio). Accepted; currently dropped downstream. */ export declare const inputAudioPartSchema: import("arktype/internal/variants/object.ts").ObjectType<{ type: "input_audio"; input_audio: { data: string; format: "mp3" | "wav"; }; }, {}>; /** OpenAI file input block (file_search / vision-document). Accepted; currently dropped downstream. */ export declare const filePartSchema: import("arktype/internal/variants/object.ts").ObjectType<{ type: "file"; file: { file_id?: string | undefined; filename?: string | undefined; file_data?: string | undefined; }; }, {}>; /** Replayed assistant refusal block. Accepted; currently dropped downstream. */ export declare const refusalPartSchema: import("arktype/internal/variants/object.ts").ObjectType<{ type: "refusal"; refusal: string; }, {}>; /** * Forward-compat catch-all for unknown content-part types. Matches every other * `{ type: string, ... }` object so a new OpenAI block kind does not 400 the * whole request; the walker ignores parts whose `type` it does not know. */ export declare const unknownPartSchema: import("arktype/internal/variants/object.ts").ObjectType<{ type: string; }, {}>; export declare const userContentPartSchema: import("arktype/internal/variants/object.ts").ObjectType<{ type: "text"; text: string; } | { type: "image_url"; image_url: string | { url: string; detail?: "auto" | "high" | "low" | undefined; }; } | { type: "input_audio"; input_audio: { data: string; format: "mp3" | "wav"; }; } | { type: "file"; file: { file_id?: string | undefined; filename?: string | undefined; file_data?: string | undefined; }; } | { type: "refusal"; refusal: string; } | { type: string; }, {}>; export declare const toolCallSchema: import("arktype/internal/variants/object.ts").ObjectType<{ id: string; type?: "function" | undefined; function: { name: string; arguments: string; }; }, {}>; export declare const toolSchema: import("arktype/internal/variants/object.ts").ObjectType<{ type: "function"; function: { name: string; description?: string | undefined; parameters?: { [x: string]: unknown; } | undefined; strict?: boolean | undefined; }; }, {}>; export declare const toolChoiceSchema: import("arktype").BaseType<"auto" | "none" | "required" | { type: "function"; function: { name: string; }; } | { type: "tool"; name: string; }, {}>; export declare const systemMessageSchema: import("arktype/internal/variants/object.ts").ObjectType<{ role: "system"; content: string | ({ type: "text"; text: string; } | { type: "image_url"; image_url: string | { url: string; detail?: "auto" | "high" | "low" | undefined; }; } | { type: "input_audio"; input_audio: { data: string; format: "mp3" | "wav"; }; } | { type: "file"; file: { file_id?: string | undefined; filename?: string | undefined; file_data?: string | undefined; }; } | { type: "refusal"; refusal: string; } | { type: string; })[]; }, {}>; export declare const developerMessageSchema: import("arktype/internal/variants/object.ts").ObjectType<{ role: "developer"; content: string | ({ type: "text"; text: string; } | { type: "image_url"; image_url: string | { url: string; detail?: "auto" | "high" | "low" | undefined; }; } | { type: "input_audio"; input_audio: { data: string; format: "mp3" | "wav"; }; } | { type: "file"; file: { file_id?: string | undefined; filename?: string | undefined; file_data?: string | undefined; }; } | { type: "refusal"; refusal: string; } | { type: string; })[]; }, {}>; export declare const userMessageSchema: import("arktype/internal/variants/object.ts").ObjectType<{ role: "user"; content: string | ({ type: "text"; text: string; } | { type: "image_url"; image_url: string | { url: string; detail?: "auto" | "high" | "low" | undefined; }; } | { type: "input_audio"; input_audio: { data: string; format: "mp3" | "wav"; }; } | { type: "file"; file: { file_id?: string | undefined; filename?: string | undefined; file_data?: string | undefined; }; } | { type: "refusal"; refusal: string; } | { type: string; })[]; }, {}>; export declare const assistantMessageSchema: import("arktype/internal/variants/object.ts").ObjectType<{ role: "assistant"; content?: string | ({ type: "text"; text: string; } | { type: "image_url"; image_url: string | { url: string; detail?: "auto" | "high" | "low" | undefined; }; } | { type: "input_audio"; input_audio: { data: string; format: "mp3" | "wav"; }; } | { type: "file"; file: { file_id?: string | undefined; filename?: string | undefined; file_data?: string | undefined; }; } | { type: "refusal"; refusal: string; } | { type: string; })[] | undefined; tool_calls?: { id: string; type?: "function" | undefined; function: { name: string; arguments: string; }; }[] | undefined; reasoning_content?: string | null | undefined; }, {}>; export declare const toolMessageSchema: import("arktype/internal/variants/object.ts").ObjectType<{ role: "tool"; content?: string | ({ type: "text"; text: string; } | { type: "image_url"; image_url: string | { url: string; detail?: "auto" | "high" | "low" | undefined; }; } | { type: "input_audio"; input_audio: { data: string; format: "mp3" | "wav"; }; } | { type: "file"; file: { file_id?: string | undefined; filename?: string | undefined; file_data?: string | undefined; }; } | { type: "refusal"; refusal: string; } | { type: string; })[] | undefined; tool_call_id?: string | undefined; name?: ((In: string) => import("arktype").Out) | undefined; }, {}>; /** * Legacy `function` role (pre-tools API). Translated to a `tool` role * canonical message in the walker so downstream providers see one shape. */ export declare const functionMessageSchema: import("arktype/internal/variants/object.ts").ObjectType<{ role: "function"; name: string; content: string | null; }, {}>; export declare const messageSchema: import("arktype/internal/variants/object.ts").ObjectType<{ role: "system"; content: string | ({ type: "text"; text: string; } | { type: "image_url"; image_url: string | { url: string; detail?: "auto" | "high" | "low" | undefined; }; } | { type: "input_audio"; input_audio: { data: string; format: "mp3" | "wav"; }; } | { type: "file"; file: { file_id?: string | undefined; filename?: string | undefined; file_data?: string | undefined; }; } | { type: "refusal"; refusal: string; } | { type: string; })[]; } | { role: "developer"; content: string | ({ type: "text"; text: string; } | { type: "image_url"; image_url: string | { url: string; detail?: "auto" | "high" | "low" | undefined; }; } | { type: "input_audio"; input_audio: { data: string; format: "mp3" | "wav"; }; } | { type: "file"; file: { file_id?: string | undefined; filename?: string | undefined; file_data?: string | undefined; }; } | { type: "refusal"; refusal: string; } | { type: string; })[]; } | { role: "user"; content: string | ({ type: "text"; text: string; } | { type: "image_url"; image_url: string | { url: string; detail?: "auto" | "high" | "low" | undefined; }; } | { type: "input_audio"; input_audio: { data: string; format: "mp3" | "wav"; }; } | { type: "file"; file: { file_id?: string | undefined; filename?: string | undefined; file_data?: string | undefined; }; } | { type: "refusal"; refusal: string; } | { type: string; })[]; } | { role: "assistant"; content?: string | ({ type: "text"; text: string; } | { type: "image_url"; image_url: string | { url: string; detail?: "auto" | "high" | "low" | undefined; }; } | { type: "input_audio"; input_audio: { data: string; format: "mp3" | "wav"; }; } | { type: "file"; file: { file_id?: string | undefined; filename?: string | undefined; file_data?: string | undefined; }; } | { type: "refusal"; refusal: string; } | { type: string; })[] | undefined; tool_calls?: { id: string; type?: "function" | undefined; function: { name: string; arguments: string; }; }[] | undefined; reasoning_content?: string | null | undefined; } | { role: "tool"; content?: string | ({ type: "text"; text: string; } | { type: "image_url"; image_url: string | { url: string; detail?: "auto" | "high" | "low" | undefined; }; } | { type: "input_audio"; input_audio: { data: string; format: "mp3" | "wav"; }; } | { type: "file"; file: { file_id?: string | undefined; filename?: string | undefined; file_data?: string | undefined; }; } | { type: "refusal"; refusal: string; } | { type: string; })[] | undefined; tool_call_id?: string | undefined; name?: ((In: string) => import("arktype").Out) | undefined; } | { role: "function"; name: string; content: string | null; }, {}>; /** * Permissive: the official OpenAI SDK sets `include_obfuscation: false` by * default. We only consume `include_usage`, so unknown keys are silently * stripped rather than 400'd. */ export declare const streamOptionsSchema: import("arktype/internal/variants/object.ts").ObjectType<{ include_usage?: boolean | undefined; }, {}>; export declare const stopSchema: import("arktype").BaseType; export declare const openaiChatRequestSchema: import("arktype/internal/variants/object.ts").ObjectType<{ model: string; messages: ({ role: "system"; content: string | ({ type: "text"; text: string; } | { type: "image_url"; image_url: string | { url: string; detail?: "auto" | "high" | "low" | undefined; }; } | { type: "input_audio"; input_audio: { data: string; format: "mp3" | "wav"; }; } | { type: "file"; file: { file_id?: string | undefined; filename?: string | undefined; file_data?: string | undefined; }; } | { type: "refusal"; refusal: string; } | { type: string; })[]; } | { role: "developer"; content: string | ({ type: "text"; text: string; } | { type: "image_url"; image_url: string | { url: string; detail?: "auto" | "high" | "low" | undefined; }; } | { type: "input_audio"; input_audio: { data: string; format: "mp3" | "wav"; }; } | { type: "file"; file: { file_id?: string | undefined; filename?: string | undefined; file_data?: string | undefined; }; } | { type: "refusal"; refusal: string; } | { type: string; })[]; } | { role: "user"; content: string | ({ type: "text"; text: string; } | { type: "image_url"; image_url: string | { url: string; detail?: "auto" | "high" | "low" | undefined; }; } | { type: "input_audio"; input_audio: { data: string; format: "mp3" | "wav"; }; } | { type: "file"; file: { file_id?: string | undefined; filename?: string | undefined; file_data?: string | undefined; }; } | { type: "refusal"; refusal: string; } | { type: string; })[]; } | { role: "assistant"; content?: string | ({ type: "text"; text: string; } | { type: "image_url"; image_url: string | { url: string; detail?: "auto" | "high" | "low" | undefined; }; } | { type: "input_audio"; input_audio: { data: string; format: "mp3" | "wav"; }; } | { type: "file"; file: { file_id?: string | undefined; filename?: string | undefined; file_data?: string | undefined; }; } | { type: "refusal"; refusal: string; } | { type: string; })[] | undefined; tool_calls?: { id: string; type?: "function" | undefined; function: { name: string; arguments: string; }; }[] | undefined; reasoning_content?: string | null | undefined; } | { role: "tool"; content?: string | ({ type: "text"; text: string; } | { type: "image_url"; image_url: string | { url: string; detail?: "auto" | "high" | "low" | undefined; }; } | { type: "input_audio"; input_audio: { data: string; format: "mp3" | "wav"; }; } | { type: "file"; file: { file_id?: string | undefined; filename?: string | undefined; file_data?: string | undefined; }; } | { type: "refusal"; refusal: string; } | { type: string; })[] | undefined; tool_call_id?: string | undefined; name?: ((In: string) => import("arktype").Out) | undefined; } | { role: "function"; name: string; content: string | null; })[]; tools?: { type: "function"; function: { name: string; description?: string | undefined; parameters?: { [x: string]: unknown; } | undefined; strict?: boolean | undefined; }; }[] | undefined; tool_choice?: "auto" | "none" | "required" | { type: "function"; function: { name: string; }; } | { type: "tool"; name: string; } | undefined; max_tokens?: number | undefined; max_completion_tokens?: number | undefined; temperature?: number | undefined; top_p?: number | undefined; stop?: string | string[] | undefined; stream?: boolean | undefined; stream_options?: { include_usage?: boolean | undefined; } | undefined; response_format?: unknown; seed?: number | undefined; presence_penalty?: number | undefined; frequency_penalty?: number | undefined; logit_bias?: { [x: string]: number; } | undefined; user?: string | undefined; reasoning_effort?: "high" | "low" | "medium" | "minimal" | "xhigh" | undefined; parallel_tool_calls?: boolean | undefined; service_tier?: "auto" | "default" | "flex" | "priority" | "scale" | undefined; metadata?: { [x: string]: unknown; } | undefined; logprobs?: unknown; top_logprobs?: unknown; prediction?: unknown; modalities?: unknown; audio?: unknown; store?: unknown; prompt_cache_key?: unknown; safety_identifier?: unknown; n?: unknown; web_search_options?: unknown; }, {}>; /** * Public types are sourced from the OpenAI SDK so the gateway stays in * lock-step with the canonical API surface; the schemas above are runtime * validators for the subset we actually accept. */ export type OpenAIChatRequest = ChatCompletionCreateParams; export type OpenAIChatMessage = ChatCompletionMessageParam; export type OpenAIChatToolCall = ChatCompletionMessageToolCall; export type OpenAIChatTool = ChatCompletionTool; export type OpenAIChatToolChoice = ChatCompletionToolChoiceOption; export type OpenAIChatContentPart = ChatCompletionContentPart;