import * as z from "zod"; import { ClosedEnum } from "../types/enums.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { ChatCompletionResponseMessage, ChatCompletionResponseMessage$Outbound } from "./chatcompletionresponsemessage.js"; import { NewLogProbsContent, NewLogProbsContent$Outbound } from "./newlogprobscontent.js"; import { NewLogProbsContentTopLogProbs, NewLogProbsContentTopLogProbs$Outbound } from "./newlogprobscontenttoplogprobs.js"; import { SDKValidationError } from "./sdkvalidationerror.js"; import { UsageInfo, UsageInfo$Outbound } from "./usageinfo.js"; /** * The reason the model stopped generating tokens. This will be "stop" if * * @remarks * the model hit a natural stop point or a provided stop sequence, or * "length" if the maximum number of tokens specified in the request was * reached. */ export declare const FinishReason: { readonly Stop: "stop"; readonly Length: "length"; }; /** * The reason the model stopped generating tokens. This will be "stop" if * * @remarks * the model hit a natural stop point or a provided stop sequence, or * "length" if the maximum number of tokens specified in the request was * reached. */ export type FinishReason = ClosedEnum; export type LogprobsNewLogProbsContent = { token?: string | undefined; logprob?: number | undefined; bytes?: Array | undefined; topLogprobs?: Array | undefined; tokenId?: number | undefined; textOffset?: number | undefined; }; export type LogprobsLogProbs = { tokens?: Array | undefined; tokenLogprobs?: Array | undefined; topLogprobs?: Array<{ [k: string]: number; }> | undefined; textOffset?: Array | undefined; tokenIds?: Array | undefined; }; /** * The log probabilities of the most likely tokens. */ export type Logprobs = LogprobsLogProbs | LogprobsNewLogProbsContent; export type RawOutput = { /** * Pieces of the prompt (like individual messages) before truncation and concatenation. Depending on prompt_truncate_len, some of the messages might be dropped. Contains a mix of strings to be tokenized and individual tokens. */ promptFragments?: Array | undefined; /** * Fully processed prompt as seen by the model. */ promptTokenIds?: Array | undefined; /** * Raw completion produced by the model before any tool calls are parsed. */ completion?: string | undefined; completionLogprobs?: NewLogProbsContent | undefined; }; export type Choices = { /** * The index of the chat completion choice. */ index: number; message: ChatCompletionResponseMessage; /** * The reason the model stopped generating tokens. This will be "stop" if * * @remarks * the model hit a natural stop point or a provided stop sequence, or * "length" if the maximum number of tokens specified in the request was * reached. */ finishReason: FinishReason; /** * The log probabilities of the most likely tokens. */ logprobs?: LogprobsLogProbs | LogprobsNewLogProbsContent | null | undefined; rawOutput?: RawOutput | undefined; }; export type CreateChatCompletionResponse = { /** * A unique identifier of the response. */ id: string; /** * The object type, which is always "chat.completion". */ object: string; /** * The Unix time in seconds when the response was generated. */ created: number; /** * The model used for the chat completion. */ model: string; /** * The list of chat completion choices. */ choices: Array; /** * Usage statistics. * * @remarks * * For streaming responses, `usage` field is included in the very last response chunk returned. * * Note that returning `usage` for streaming requests is an OpenAI API extension. If you use OpenAI SDK, you might access the field directly even if it's not present in the type signature in the SDK. */ usage?: UsageInfo | null | undefined; }; /** @internal */ export declare const FinishReason$inboundSchema: z.ZodNativeEnum; /** @internal */ export declare const FinishReason$outboundSchema: z.ZodNativeEnum; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace FinishReason$ { /** @deprecated use `FinishReason$inboundSchema` instead. */ const inboundSchema: z.ZodNativeEnum<{ readonly Stop: "stop"; readonly Length: "length"; }>; /** @deprecated use `FinishReason$outboundSchema` instead. */ const outboundSchema: z.ZodNativeEnum<{ readonly Stop: "stop"; readonly Length: "length"; }>; } /** @internal */ export declare const LogprobsNewLogProbsContent$inboundSchema: z.ZodType; /** @internal */ export type LogprobsNewLogProbsContent$Outbound = { token?: string | undefined; logprob?: number | undefined; bytes?: Array | undefined; top_logprobs?: Array | undefined; token_id?: number | undefined; text_offset?: number | undefined; }; /** @internal */ export declare const LogprobsNewLogProbsContent$outboundSchema: z.ZodType; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace LogprobsNewLogProbsContent$ { /** @deprecated use `LogprobsNewLogProbsContent$inboundSchema` instead. */ const inboundSchema: z.ZodType; /** @deprecated use `LogprobsNewLogProbsContent$outboundSchema` instead. */ const outboundSchema: z.ZodType; /** @deprecated use `LogprobsNewLogProbsContent$Outbound` instead. */ type Outbound = LogprobsNewLogProbsContent$Outbound; } export declare function logprobsNewLogProbsContentToJSON(logprobsNewLogProbsContent: LogprobsNewLogProbsContent): string; export declare function logprobsNewLogProbsContentFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const LogprobsLogProbs$inboundSchema: z.ZodType; /** @internal */ export type LogprobsLogProbs$Outbound = { tokens?: Array | undefined; token_logprobs?: Array | undefined; top_logprobs?: Array<{ [k: string]: number; }> | undefined; text_offset?: Array | undefined; token_ids?: Array | undefined; }; /** @internal */ export declare const LogprobsLogProbs$outboundSchema: z.ZodType; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace LogprobsLogProbs$ { /** @deprecated use `LogprobsLogProbs$inboundSchema` instead. */ const inboundSchema: z.ZodType; /** @deprecated use `LogprobsLogProbs$outboundSchema` instead. */ const outboundSchema: z.ZodType; /** @deprecated use `LogprobsLogProbs$Outbound` instead. */ type Outbound = LogprobsLogProbs$Outbound; } export declare function logprobsLogProbsToJSON(logprobsLogProbs: LogprobsLogProbs): string; export declare function logprobsLogProbsFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const Logprobs$inboundSchema: z.ZodType; /** @internal */ export type Logprobs$Outbound = LogprobsLogProbs$Outbound | LogprobsNewLogProbsContent$Outbound; /** @internal */ export declare const Logprobs$outboundSchema: z.ZodType; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace Logprobs$ { /** @deprecated use `Logprobs$inboundSchema` instead. */ const inboundSchema: z.ZodType; /** @deprecated use `Logprobs$outboundSchema` instead. */ const outboundSchema: z.ZodType; /** @deprecated use `Logprobs$Outbound` instead. */ type Outbound = Logprobs$Outbound; } export declare function logprobsToJSON(logprobs: Logprobs): string; export declare function logprobsFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const RawOutput$inboundSchema: z.ZodType; /** @internal */ export type RawOutput$Outbound = { prompt_fragments?: Array | undefined; prompt_token_ids?: Array | undefined; completion?: string | undefined; completion_logprobs?: NewLogProbsContent$Outbound | undefined; }; /** @internal */ export declare const RawOutput$outboundSchema: z.ZodType; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace RawOutput$ { /** @deprecated use `RawOutput$inboundSchema` instead. */ const inboundSchema: z.ZodType; /** @deprecated use `RawOutput$outboundSchema` instead. */ const outboundSchema: z.ZodType; /** @deprecated use `RawOutput$Outbound` instead. */ type Outbound = RawOutput$Outbound; } export declare function rawOutputToJSON(rawOutput: RawOutput): string; export declare function rawOutputFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const Choices$inboundSchema: z.ZodType; /** @internal */ export type Choices$Outbound = { index: number; message: ChatCompletionResponseMessage$Outbound; finish_reason: string; logprobs?: LogprobsLogProbs$Outbound | LogprobsNewLogProbsContent$Outbound | null | undefined; raw_output?: RawOutput$Outbound | undefined; }; /** @internal */ export declare const Choices$outboundSchema: z.ZodType; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace Choices$ { /** @deprecated use `Choices$inboundSchema` instead. */ const inboundSchema: z.ZodType; /** @deprecated use `Choices$outboundSchema` instead. */ const outboundSchema: z.ZodType; /** @deprecated use `Choices$Outbound` instead. */ type Outbound = Choices$Outbound; } export declare function choicesToJSON(choices: Choices): string; export declare function choicesFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const CreateChatCompletionResponse$inboundSchema: z.ZodType; /** @internal */ export type CreateChatCompletionResponse$Outbound = { id: string; object: string; created: number; model: string; choices: Array; usage?: UsageInfo$Outbound | null | undefined; }; /** @internal */ export declare const CreateChatCompletionResponse$outboundSchema: z.ZodType; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace CreateChatCompletionResponse$ { /** @deprecated use `CreateChatCompletionResponse$inboundSchema` instead. */ const inboundSchema: z.ZodType; /** @deprecated use `CreateChatCompletionResponse$outboundSchema` instead. */ const outboundSchema: z.ZodType; /** @deprecated use `CreateChatCompletionResponse$Outbound` instead. */ type Outbound = CreateChatCompletionResponse$Outbound; } export declare function createChatCompletionResponseToJSON(createChatCompletionResponse: CreateChatCompletionResponse): string; export declare function createChatCompletionResponseFromJSON(jsonString: string): SafeParseResult; //# sourceMappingURL=createchatcompletionresponse.d.ts.map