import * as z from "zod/v3"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type OpenAIChatCompletionChoiceFile2 = { /** * The unique identifier of a previously uploaded file */ fileId: string; /** * Optional filename override */ filename?: string | undefined; }; export type OpenAIChatCompletionChoiceFile1 = { /** * The name of the file */ filename: string; /** * Base64-encoded file data */ fileData: string; }; /** * The file to include in the message, either as raw data or by reference */ export type OpenAIChatCompletionChoice2File = OpenAIChatCompletionChoiceFile1 | OpenAIChatCompletionChoiceFile2; export type OpenAIChatCompletionChoice24 = { /** * Content type identifier for file content */ type: "file"; /** * The file to include in the message, either as raw data or by reference */ file: OpenAIChatCompletionChoiceFile1 | OpenAIChatCompletionChoiceFile2; }; /** * The format of the encoded audio data */ export declare const OpenAIChatCompletionChoice2Format: { readonly Wav: "wav"; readonly Mp3: "mp3"; }; /** * The format of the encoded audio data */ export type OpenAIChatCompletionChoice2Format = ClosedEnum; export type OpenAIChatCompletionChoice2InputAudio = { /** * Base64-encoded audio data */ data: string; /** * The format of the encoded audio data */ format: OpenAIChatCompletionChoice2Format; }; export type OpenAIChatCompletionChoice23 = { /** * Content type identifier for audio input content */ type: "input_audio"; inputAudio: OpenAIChatCompletionChoice2InputAudio; }; /** * The detail level of the image analysis. 'low' disables high-res mode, 'high' enables it, 'auto' lets the model decide. */ export declare const OpenAIChatCompletionChoice2Detail: { readonly Auto: "auto"; readonly Low: "low"; readonly High: "high"; }; /** * The detail level of the image analysis. 'low' disables high-res mode, 'high' enables it, 'auto' lets the model decide. */ export type OpenAIChatCompletionChoice2Detail = ClosedEnum; export type TwoImageUrl = { /** * The URL of the image, or a base64-encoded image data URL */ url: string; /** * The detail level of the image analysis. 'low' disables high-res mode, 'high' enables it, 'auto' lets the model decide. */ detail?: OpenAIChatCompletionChoice2Detail | undefined; }; export type OpenAIChatCompletionChoice22 = { /** * Content type identifier for image URL content */ type: "image_url"; imageUrl: TwoImageUrl; }; export type OpenAIChatCompletionChoice21 = { /** * Content type identifier for text content */ type: "text"; /** * The text content to include in the message */ text: string; }; /** * A content part that can be included in a message. Supports text, images, audio, and files. */ export type Content2 = OpenAIChatCompletionChoice21 | OpenAIChatCompletionChoice22 | OpenAIChatCompletionChoice23 | OpenAIChatCompletionChoice24; /** * The contents of the assistant message. Can be null when the message contains tool calls only. */ export type OpenAIChatCompletionChoiceContent = string | Array; /** * The function that the model called */ export type OpenAIChatCompletionChoiceFunction = { /** * The name of the function to call */ name: string; /** * The arguments to call the function with, as a JSON string */ arguments: string; }; export type OpenAIChatCompletionChoiceToolCalls = { /** * The ID of the tool call */ id: string; /** * The type of the tool. Currently only 'function' is supported. */ type: "function"; /** * The function that the model called */ function: OpenAIChatCompletionChoiceFunction; }; /** * The message generated by the model */ export type Message = { /** * The role of the message author, must be 'assistant' for assistant messages */ role: "assistant"; /** * An optional name for the participant. For tool role messages, this is the name of the function called. */ name?: string | undefined; /** * Tool call that this message is responding to. Required when role is 'tool'. */ toolCallId?: string | undefined; /** * The contents of the assistant message. Can be null when the message contains tool calls only. */ content: string | Array | null; /** * The reasoning content generated by the model before producing the final response. Present for models that support chain-of-thought reasoning. */ reasoning?: string | null | undefined; /** * The tool calls generated by the model, such as function calls. */ toolCalls?: Array | undefined; }; /** * The reason why the model stopped generating tokens. */ export declare const One: { readonly Stop: "stop"; readonly Length: "length"; readonly ToolCalls: "tool_calls"; readonly ContentFilter: "content_filter"; }; /** * The reason why the model stopped generating tokens. */ export type One = ClosedEnum; export type FinishReason = One | string; /** * Log probability information for the choice */ export type Logprobs = { /** * The list of tokens */ tokens: Array; /** * The log probability of each token */ tokenLogprobs: Array; /** * The top log probabilities for each token position */ topLogprobs: Array<{ [k: string]: number; }>; /** * The character offset from the beginning of the returned text for each token */ textOffset: Array; }; /** * A chat completion choice generated by the model */ export type OpenAIChatCompletionChoice = { /** * The index of this choice in the list of choices */ index: number; /** * The message generated by the model */ message: Message; /** * The reason the model stopped generating tokens. 'stop' means natural stop point or provided stop sequence, 'length' means max_tokens limit reached, 'tool_calls' means the model called a tool, 'content_filter' means content was filtered due to policy violations. */ finishReason: One | string | null; /** * Log probability information for the choice */ logprobs?: Logprobs | null | undefined; }; /** @internal */ export declare const OpenAIChatCompletionChoiceFile2$inboundSchema: z.ZodType; /** @internal */ export type OpenAIChatCompletionChoiceFile2$Outbound = { file_id: string; filename?: string | undefined; }; /** @internal */ export declare const OpenAIChatCompletionChoiceFile2$outboundSchema: z.ZodType; export declare function openAIChatCompletionChoiceFile2ToJSON(openAIChatCompletionChoiceFile2: OpenAIChatCompletionChoiceFile2): string; export declare function openAIChatCompletionChoiceFile2FromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const OpenAIChatCompletionChoiceFile1$inboundSchema: z.ZodType; /** @internal */ export type OpenAIChatCompletionChoiceFile1$Outbound = { filename: string; file_data: string; }; /** @internal */ export declare const OpenAIChatCompletionChoiceFile1$outboundSchema: z.ZodType; export declare function openAIChatCompletionChoiceFile1ToJSON(openAIChatCompletionChoiceFile1: OpenAIChatCompletionChoiceFile1): string; export declare function openAIChatCompletionChoiceFile1FromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const OpenAIChatCompletionChoice2File$inboundSchema: z.ZodType; /** @internal */ export type OpenAIChatCompletionChoice2File$Outbound = OpenAIChatCompletionChoiceFile1$Outbound | OpenAIChatCompletionChoiceFile2$Outbound; /** @internal */ export declare const OpenAIChatCompletionChoice2File$outboundSchema: z.ZodType; export declare function openAIChatCompletionChoice2FileToJSON(openAIChatCompletionChoice2File: OpenAIChatCompletionChoice2File): string; export declare function openAIChatCompletionChoice2FileFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const OpenAIChatCompletionChoice24$inboundSchema: z.ZodType; /** @internal */ export type OpenAIChatCompletionChoice24$Outbound = { type: "file"; file: OpenAIChatCompletionChoiceFile1$Outbound | OpenAIChatCompletionChoiceFile2$Outbound; }; /** @internal */ export declare const OpenAIChatCompletionChoice24$outboundSchema: z.ZodType; export declare function openAIChatCompletionChoice24ToJSON(openAIChatCompletionChoice24: OpenAIChatCompletionChoice24): string; export declare function openAIChatCompletionChoice24FromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const OpenAIChatCompletionChoice2Format$inboundSchema: z.ZodNativeEnum; /** @internal */ export declare const OpenAIChatCompletionChoice2Format$outboundSchema: z.ZodNativeEnum; /** @internal */ export declare const OpenAIChatCompletionChoice2InputAudio$inboundSchema: z.ZodType; /** @internal */ export type OpenAIChatCompletionChoice2InputAudio$Outbound = { data: string; format: string; }; /** @internal */ export declare const OpenAIChatCompletionChoice2InputAudio$outboundSchema: z.ZodType; export declare function openAIChatCompletionChoice2InputAudioToJSON(openAIChatCompletionChoice2InputAudio: OpenAIChatCompletionChoice2InputAudio): string; export declare function openAIChatCompletionChoice2InputAudioFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const OpenAIChatCompletionChoice23$inboundSchema: z.ZodType; /** @internal */ export type OpenAIChatCompletionChoice23$Outbound = { type: "input_audio"; input_audio: OpenAIChatCompletionChoice2InputAudio$Outbound; }; /** @internal */ export declare const OpenAIChatCompletionChoice23$outboundSchema: z.ZodType; export declare function openAIChatCompletionChoice23ToJSON(openAIChatCompletionChoice23: OpenAIChatCompletionChoice23): string; export declare function openAIChatCompletionChoice23FromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const OpenAIChatCompletionChoice2Detail$inboundSchema: z.ZodNativeEnum; /** @internal */ export declare const OpenAIChatCompletionChoice2Detail$outboundSchema: z.ZodNativeEnum; /** @internal */ export declare const TwoImageUrl$inboundSchema: z.ZodType; /** @internal */ export type TwoImageUrl$Outbound = { url: string; detail?: string | undefined; }; /** @internal */ export declare const TwoImageUrl$outboundSchema: z.ZodType; export declare function twoImageUrlToJSON(twoImageUrl: TwoImageUrl): string; export declare function twoImageUrlFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const OpenAIChatCompletionChoice22$inboundSchema: z.ZodType; /** @internal */ export type OpenAIChatCompletionChoice22$Outbound = { type: "image_url"; image_url: TwoImageUrl$Outbound; }; /** @internal */ export declare const OpenAIChatCompletionChoice22$outboundSchema: z.ZodType; export declare function openAIChatCompletionChoice22ToJSON(openAIChatCompletionChoice22: OpenAIChatCompletionChoice22): string; export declare function openAIChatCompletionChoice22FromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const OpenAIChatCompletionChoice21$inboundSchema: z.ZodType; /** @internal */ export type OpenAIChatCompletionChoice21$Outbound = { type: "text"; text: string; }; /** @internal */ export declare const OpenAIChatCompletionChoice21$outboundSchema: z.ZodType; export declare function openAIChatCompletionChoice21ToJSON(openAIChatCompletionChoice21: OpenAIChatCompletionChoice21): string; export declare function openAIChatCompletionChoice21FromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const Content2$inboundSchema: z.ZodType; /** @internal */ export type Content2$Outbound = OpenAIChatCompletionChoice21$Outbound | OpenAIChatCompletionChoice22$Outbound | OpenAIChatCompletionChoice23$Outbound | OpenAIChatCompletionChoice24$Outbound; /** @internal */ export declare const Content2$outboundSchema: z.ZodType; export declare function content2ToJSON(content2: Content2): string; export declare function content2FromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const OpenAIChatCompletionChoiceContent$inboundSchema: z.ZodType; /** @internal */ export type OpenAIChatCompletionChoiceContent$Outbound = string | Array; /** @internal */ export declare const OpenAIChatCompletionChoiceContent$outboundSchema: z.ZodType; export declare function openAIChatCompletionChoiceContentToJSON(openAIChatCompletionChoiceContent: OpenAIChatCompletionChoiceContent): string; export declare function openAIChatCompletionChoiceContentFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const OpenAIChatCompletionChoiceFunction$inboundSchema: z.ZodType; /** @internal */ export type OpenAIChatCompletionChoiceFunction$Outbound = { name: string; arguments: string; }; /** @internal */ export declare const OpenAIChatCompletionChoiceFunction$outboundSchema: z.ZodType; export declare function openAIChatCompletionChoiceFunctionToJSON(openAIChatCompletionChoiceFunction: OpenAIChatCompletionChoiceFunction): string; export declare function openAIChatCompletionChoiceFunctionFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const OpenAIChatCompletionChoiceToolCalls$inboundSchema: z.ZodType; /** @internal */ export type OpenAIChatCompletionChoiceToolCalls$Outbound = { id: string; type: "function"; function: OpenAIChatCompletionChoiceFunction$Outbound; }; /** @internal */ export declare const OpenAIChatCompletionChoiceToolCalls$outboundSchema: z.ZodType; export declare function openAIChatCompletionChoiceToolCallsToJSON(openAIChatCompletionChoiceToolCalls: OpenAIChatCompletionChoiceToolCalls): string; export declare function openAIChatCompletionChoiceToolCallsFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const Message$inboundSchema: z.ZodType; /** @internal */ export type Message$Outbound = { role: "assistant"; name?: string | undefined; tool_call_id?: string | undefined; content: string | Array | null; reasoning?: string | null | undefined; tool_calls?: Array | undefined; }; /** @internal */ export declare const Message$outboundSchema: z.ZodType; export declare function messageToJSON(message: Message): string; export declare function messageFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const One$inboundSchema: z.ZodNativeEnum; /** @internal */ export declare const One$outboundSchema: z.ZodNativeEnum; /** @internal */ export declare const FinishReason$inboundSchema: z.ZodType; /** @internal */ export type FinishReason$Outbound = string | string; /** @internal */ export declare const FinishReason$outboundSchema: z.ZodType; export declare function finishReasonToJSON(finishReason: FinishReason): string; export declare function finishReasonFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const Logprobs$inboundSchema: z.ZodType; /** @internal */ export type Logprobs$Outbound = { tokens: Array; token_logprobs: Array; top_logprobs: Array<{ [k: string]: number; }>; text_offset: Array; }; /** @internal */ export declare const Logprobs$outboundSchema: z.ZodType; export declare function logprobsToJSON(logprobs: Logprobs): string; export declare function logprobsFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const OpenAIChatCompletionChoice$inboundSchema: z.ZodType; /** @internal */ export type OpenAIChatCompletionChoice$Outbound = { index: number; message: Message$Outbound; finish_reason: string | string | null; logprobs?: Logprobs$Outbound | null | undefined; }; /** @internal */ export declare const OpenAIChatCompletionChoice$outboundSchema: z.ZodType; export declare function openAIChatCompletionChoiceToJSON(openAIChatCompletionChoice: OpenAIChatCompletionChoice): string; export declare function openAIChatCompletionChoiceFromJSON(jsonString: string): SafeParseResult; //# sourceMappingURL=openaichatcompletionchoice.d.ts.map