/** * ArkType schemas for the OpenAI Responses API request shape we accept on the * gateway. Mirrors https://platform.openai.com/docs/api-reference/responses. * * Unsupported / opaque controls (background/include/metadata/prompt/…) are * accepted as `"unknown"` optional so we silently ignore rather than 400. * Real clients (codex, openai-python, llm-git) routinely send these and a 400 * is a worse outcome than dropping them on the floor. */ import type { EasyInputMessage, ResponseCreateParams, ResponseFunctionToolCall, ResponseInputContent, ResponseInputItem, ResponseOutputMessage, ResponseReasoningItem, Tool as ResponsesTool } from "./openai-responses-wire"; declare const inputImageBlockSchema: import("arktype/internal/variants/object.ts").ObjectType<{ type: "input_image"; detail?: "auto" | "high" | "low" | undefined; image_url?: string | undefined; file_id?: string | undefined; }, {}>; declare const inputFileBlockSchema: import("arktype/internal/variants/object.ts").ObjectType<{ type: "input_file"; file_id?: string | undefined; filename?: string | undefined; file_data?: string | undefined; }, {}>; declare const outputRefusalSchema: import("arktype/internal/variants/object.ts").ObjectType<{ type: "refusal"; refusal: string; }, {}>; declare const customToolCallItemSchema: import("arktype/internal/variants/object.ts").ObjectType<{ type: "custom_tool_call"; id?: string | undefined; call_id: string; name: string; input: string; }, {}>; declare const customToolCallOutputItemSchema: import("arktype/internal/variants/object.ts").ObjectType<{ type: "custom_tool_call_output"; call_id: string; output: string; }, {}>; /** * Direct mapping to standard types. */ export declare const inputItemSchema: import("arktype/internal/variants/object.ts").ObjectType<{ type?: "message" | undefined; role: "developer" | "user"; content?: string | ({ type: "input_text"; text: string; } | { type: "text"; text: string; } | { type: "input_image"; detail?: "auto" | "high" | "low" | undefined; image_url?: string | undefined; file_id?: string | undefined; } | { type: "input_file"; file_id?: string | undefined; filename?: string | undefined; file_data?: string | undefined; })[] | undefined; } | { type?: "message" | undefined; role: "system"; content?: string | ({ type: "input_text"; text: string; } | { type: "text"; text: string; } | { type: "input_image"; detail?: "auto" | "high" | "low" | undefined; image_url?: string | undefined; file_id?: string | undefined; } | { type: "input_file"; file_id?: string | undefined; filename?: string | undefined; file_data?: string | undefined; })[] | undefined; } | { type?: "message" | undefined; id?: string | undefined; role: "assistant"; content?: string | ({ type: "text"; text: string; } | { type: "output_text"; text: string; } | { type: "refusal"; refusal: string; })[] | undefined; status?: "completed" | "in_progress" | "incomplete" | undefined; phase?: "commentary" | "final_answer" | null | undefined; } | { type: "reasoning"; id?: string | undefined; summary?: { type: "summary_text"; text: string; }[] | undefined; content?: { type: "reasoning_text"; text: string; }[] | undefined; } | { type: "function_call"; id?: string | undefined; call_id: string; name: string; arguments?: string | undefined; } | { type: "function_call_output"; call_id: string; output?: string | ({ type: "text"; text: string; } | { type: "output_text"; text: string; } | { type: "refusal"; refusal: string; })[] | undefined; } | { type: "custom_tool_call"; id?: string | undefined; call_id: string; name: string; input: string; } | { type: "custom_tool_call_output"; call_id: string; output: string; } | { type: string; }, {}>; export type OpenAIResponsesUserItem = EasyInputMessage | ResponseInputItem.Message; export type OpenAIResponsesSystemItem = EasyInputMessage | ResponseInputItem.Message; export type OpenAIResponsesAssistantItem = EasyInputMessage | ResponseOutputMessage; export type OpenAIResponsesReasoningItem = ResponseReasoningItem; export type OpenAIResponsesFunctionCallItem = ResponseFunctionToolCall; export type OpenAIResponsesFunctionCallOutputItem = ResponseInputItem.FunctionCallOutput; /** Inferred shape of the custom tool call input item (no canonical SDK alias). */ export type OpenAIResponsesCustomToolCallItem = typeof customToolCallItemSchema.infer; export type OpenAIResponsesCustomToolCallOutputItem = typeof customToolCallOutputItemSchema.infer; export type OpenAIResponsesInputImageBlock = typeof inputImageBlockSchema.infer; export type OpenAIResponsesInputFileBlock = typeof inputFileBlockSchema.infer; export type OpenAIResponsesOutputRefusalBlock = typeof outputRefusalSchema.infer; export declare const toolSchema: import("arktype/internal/variants/object.ts").ObjectType<{ type: "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"; name: string; } | { type: "custom"; name: string; } | { type: "code_interpreter" | "computer_use_preview" | "file_search" | "image_generation" | "mcp" | "web_search_preview"; } | { type: "allowed_tools"; mode: "auto" | "required"; tools: { type: string; name?: string | undefined; }[]; }, {}>; export declare const reasoningConfigSchema: import("arktype/internal/variants/object.ts").ObjectType<{ effort?: string | undefined; summary?: "auto" | "concise" | "detailed" | "none" | undefined; }, {}>; export declare const stopSchema: import("arktype").BaseType; export declare const openaiResponsesRequestSchema: import("arktype/internal/variants/object.ts").ObjectType<{ model: string; input?: string | ({ type?: "message" | undefined; role: "developer" | "user"; content?: string | ({ type: "input_text"; text: string; } | { type: "text"; text: string; } | { type: "input_image"; detail?: "auto" | "high" | "low" | undefined; image_url?: string | undefined; file_id?: string | undefined; } | { type: "input_file"; file_id?: string | undefined; filename?: string | undefined; file_data?: string | undefined; })[] | undefined; } | { type?: "message" | undefined; role: "system"; content?: string | ({ type: "input_text"; text: string; } | { type: "text"; text: string; } | { type: "input_image"; detail?: "auto" | "high" | "low" | undefined; image_url?: string | undefined; file_id?: string | undefined; } | { type: "input_file"; file_id?: string | undefined; filename?: string | undefined; file_data?: string | undefined; })[] | undefined; } | { type?: "message" | undefined; id?: string | undefined; role: "assistant"; content?: string | ({ type: "text"; text: string; } | { type: "output_text"; text: string; } | { type: "refusal"; refusal: string; })[] | undefined; status?: "completed" | "in_progress" | "incomplete" | undefined; phase?: "commentary" | "final_answer" | null | undefined; } | { type: "reasoning"; id?: string | undefined; summary?: { type: "summary_text"; text: string; }[] | undefined; content?: { type: "reasoning_text"; text: string; }[] | undefined; } | { type: "function_call"; id?: string | undefined; call_id: string; name: string; arguments?: string | undefined; } | { type: "function_call_output"; call_id: string; output?: string | ({ type: "text"; text: string; } | { type: "output_text"; text: string; } | { type: "refusal"; refusal: string; })[] | undefined; } | { type: "custom_tool_call"; id?: string | undefined; call_id: string; name: string; input: string; } | { type: "custom_tool_call_output"; call_id: string; output: string; } | { type: string; })[] | undefined; instructions?: string | null | undefined; tools?: ({ type: "function"; name: string; description?: string | undefined; parameters?: { [x: string]: unknown; } | undefined; strict?: boolean | undefined; } | { type: string; })[] | undefined; tool_choice?: "auto" | "none" | "required" | { type: "function"; name: string; } | { type: "custom"; name: string; } | { type: "code_interpreter" | "computer_use_preview" | "file_search" | "image_generation" | "mcp" | "web_search_preview"; } | { type: "allowed_tools"; mode: "auto" | "required"; tools: { type: string; name?: string | undefined; }[]; } | undefined; max_output_tokens?: number | undefined; temperature?: number | undefined; top_p?: number | undefined; stop?: string | string[] | null | undefined; stream?: boolean | undefined; reasoning?: { effort?: string | undefined; summary?: "auto" | "concise" | "detailed" | "none" | undefined; } | undefined; store?: boolean | undefined; previous_response_id?: string | undefined; parallel_tool_calls?: boolean | undefined; prompt_cache_key?: string | undefined; metadata?: unknown; user?: string | undefined; service_tier?: string | undefined; presence_penalty?: number | undefined; frequency_penalty?: number | undefined; background?: unknown; include?: unknown; prompt?: unknown; safety_identifier?: unknown; text?: unknown; top_logprobs?: unknown; truncation?: 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 OpenAIResponsesRequest = ResponseCreateParams; export type OpenAIResponsesInputItem = ResponseInputItem; export type OpenAIResponsesTool = ResponsesTool; export type OpenAIResponsesToolChoice = NonNullable; export type OpenAIResponsesInputContent = ResponseInputContent; export type OpenAIResponsesOutputContent = ResponseOutputMessage["content"][number]; export {};