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"; import { OpenAIRequestMessage, OpenAIRequestMessage$Outbound } from "./openairequestmessage.js"; import { OpenAIToolDefinition, OpenAIToolDefinition$Outbound } from "./openaitooldefinition.js"; /** * The function to call */ export type ToolChoiceFunction = { /** * The name of the function to call */ name: string; }; /** * Forces the model to call a specific function */ export type Four = { /** * The type of the tool. Currently only 'function' is supported. */ type: "function"; /** * The function to call */ function: ToolChoiceFunction; }; /** * Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. */ export type Stop = string | Array; export declare const Type2: { readonly Text: "text"; readonly JsonObject: "json_object"; }; export type Type2 = ClosedEnum; /** * The format type. Use 'json_object' to enable JSON mode, guaranteeing the message the model generates is valid JSON. */ export type OpenAIChatCompletionRequestParamsType = string | Type2; /** * JSON Schema definition for structured output. Required when type is 'json_schema'. */ export type JsonSchema = { name: string; schema: { [k: string]: any; }; strict?: boolean | undefined; }; /** * An object specifying the format that the model must output. Setting to { 'type': 'json_object' } enables JSON mode. */ export type OpenAIChatCompletionRequestParamsResponseFormat = { /** * The format type. Use 'json_object' to enable JSON mode, guaranteeing the message the model generates is valid JSON. */ type: string | Type2; /** * JSON Schema definition for structured output. Required when type is 'json_schema'. */ jsonSchema?: JsonSchema | undefined; }; /** * Options for streaming response. Only set this when you set stream: true. */ export type StreamOptions = { /** * If set, an additional chunk with token usage statistics will be streamed before the data: [DONE] message. The usage field shows total token usage for the entire request. */ includeUsage?: boolean | undefined; }; export declare const ReasoningEffort: { readonly None: "none"; readonly Minimal: "minimal"; readonly Low: "low"; readonly Medium: "medium"; readonly High: "high"; readonly Xhigh: "xhigh"; }; export type ReasoningEffort = ClosedEnum; /** * Request parameters for creating a chat completion. Based on the OpenAI Chat Completions API. */ export type OpenAIChatCompletionRequestParams = { /** * ID of the model to use. You can use provider:model format or just the model name with a default provider. */ model: string; /** * A list of messages comprising the conversation so far. At least one message is required. */ messages: Array; /** * A list of tools the model may call. Use this to provide function definitions the model can invoke. */ tools?: Array | undefined; /** * Controls which (if any) tool is called by the model. 'none' means the model will not call any tool. 'auto' means the model can pick. 'required' forces a tool call. */ toolChoice?: any | undefined; /** * If set, partial message deltas will be sent as server-sent events. Note: This field is ignored by the streaming endpoint, used only by OpenAI-compatible client endpoints. */ stream?: boolean | undefined; /** * How many chat completion choices to generate for each input message. Default is 1. */ n?: number | undefined; /** * The maximum number of tokens that can be generated in the chat completion. The total length of input tokens and generated tokens is limited by the model's context length. */ maxTokens?: number | undefined; /** * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. */ temperature?: number | undefined; /** * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. */ topP?: number | undefined; /** * Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. */ frequencyPenalty?: number | undefined; /** * Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. */ presencePenalty?: number | undefined; /** * If specified, the system will make a best effort to sample deterministically. Determinism is not guaranteed, but the same seed should typically return similar results. */ seed?: number | undefined; /** * Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. */ stop?: string | Array | undefined; /** * An object specifying the format that the model must output. Setting to { 'type': 'json_object' } enables JSON mode. */ responseFormat?: OpenAIChatCompletionRequestParamsResponseFormat | undefined; /** * Whether to return log probabilities of the output tokens. If true, returns the log probabilities of each output token returned in the content of message. */ logprobs?: boolean | undefined; /** * An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to true if this parameter is used. */ topLogprobs?: number | undefined; /** * A unique identifier representing your end-user, which can help monitor and detect abuse. Also used for usage tracking and analytics. */ user?: string | undefined; /** * Options for streaming response. Only set this when you set stream: true. */ streamOptions?: StreamOptions | undefined; /** * Whether to enable parallel function calling during tool use. */ parallelToolCalls?: boolean | undefined; /** * Constrains effort on reasoning for reasoning models. Lower effort results in faster responses and fewer reasoning tokens. Supported values: 'none', 'minimal', 'low', 'medium', 'high', 'xhigh', or null. */ reasoningEffort?: ReasoningEffort | null | undefined; /** * When true, the gateway analyzes request complexity and automatically routes between quantized, MoE, and dense variants of the requested model family. */ autoRouting?: boolean | undefined; }; /** @internal */ export declare const ToolChoiceFunction$inboundSchema: z.ZodType; /** @internal */ export type ToolChoiceFunction$Outbound = { name: string; }; /** @internal */ export declare const ToolChoiceFunction$outboundSchema: z.ZodType; export declare function toolChoiceFunctionToJSON(toolChoiceFunction: ToolChoiceFunction): string; export declare function toolChoiceFunctionFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const Four$inboundSchema: z.ZodType; /** @internal */ export type Four$Outbound = { type: "function"; function: ToolChoiceFunction$Outbound; }; /** @internal */ export declare const Four$outboundSchema: z.ZodType; export declare function fourToJSON(four: Four): string; export declare function fourFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const Stop$inboundSchema: z.ZodType; /** @internal */ export type Stop$Outbound = string | Array; /** @internal */ export declare const Stop$outboundSchema: z.ZodType; export declare function stopToJSON(stop: Stop): string; export declare function stopFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const Type2$inboundSchema: z.ZodNativeEnum; /** @internal */ export declare const Type2$outboundSchema: z.ZodNativeEnum; /** @internal */ export declare const OpenAIChatCompletionRequestParamsType$inboundSchema: z.ZodType; /** @internal */ export type OpenAIChatCompletionRequestParamsType$Outbound = string | string; /** @internal */ export declare const OpenAIChatCompletionRequestParamsType$outboundSchema: z.ZodType; export declare function openAIChatCompletionRequestParamsTypeToJSON(openAIChatCompletionRequestParamsType: OpenAIChatCompletionRequestParamsType): string; export declare function openAIChatCompletionRequestParamsTypeFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const JsonSchema$inboundSchema: z.ZodType; /** @internal */ export type JsonSchema$Outbound = { name: string; schema: { [k: string]: any; }; strict?: boolean | undefined; }; /** @internal */ export declare const JsonSchema$outboundSchema: z.ZodType; export declare function jsonSchemaToJSON(jsonSchema: JsonSchema): string; export declare function jsonSchemaFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const OpenAIChatCompletionRequestParamsResponseFormat$inboundSchema: z.ZodType; /** @internal */ export type OpenAIChatCompletionRequestParamsResponseFormat$Outbound = { type: string | string; json_schema?: JsonSchema$Outbound | undefined; }; /** @internal */ export declare const OpenAIChatCompletionRequestParamsResponseFormat$outboundSchema: z.ZodType; export declare function openAIChatCompletionRequestParamsResponseFormatToJSON(openAIChatCompletionRequestParamsResponseFormat: OpenAIChatCompletionRequestParamsResponseFormat): string; export declare function openAIChatCompletionRequestParamsResponseFormatFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const StreamOptions$inboundSchema: z.ZodType; /** @internal */ export type StreamOptions$Outbound = { include_usage?: boolean | undefined; }; /** @internal */ export declare const StreamOptions$outboundSchema: z.ZodType; export declare function streamOptionsToJSON(streamOptions: StreamOptions): string; export declare function streamOptionsFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const ReasoningEffort$inboundSchema: z.ZodNativeEnum; /** @internal */ export declare const ReasoningEffort$outboundSchema: z.ZodNativeEnum; /** @internal */ export declare const OpenAIChatCompletionRequestParams$inboundSchema: z.ZodType; /** @internal */ export type OpenAIChatCompletionRequestParams$Outbound = { model: string; messages: Array; tools?: Array | undefined; tool_choice?: any | undefined; stream?: boolean | undefined; n?: number | undefined; max_tokens?: number | undefined; temperature?: number | undefined; top_p?: number | undefined; frequency_penalty?: number | undefined; presence_penalty?: number | undefined; seed?: number | undefined; stop?: string | Array | undefined; response_format?: OpenAIChatCompletionRequestParamsResponseFormat$Outbound | undefined; logprobs?: boolean | undefined; top_logprobs?: number | undefined; user?: string | undefined; stream_options?: StreamOptions$Outbound | undefined; parallel_tool_calls: boolean; reasoning_effort?: string | null | undefined; auto_routing?: boolean | undefined; }; /** @internal */ export declare const OpenAIChatCompletionRequestParams$outboundSchema: z.ZodType; export declare function openAIChatCompletionRequestParamsToJSON(openAIChatCompletionRequestParams: OpenAIChatCompletionRequestParams): string; export declare function openAIChatCompletionRequestParamsFromJSON(jsonString: string): SafeParseResult; //# sourceMappingURL=openaichatcompletionrequestparams.d.ts.map