import * as z from "zod"; import { ClosedEnum } from "../types/enums.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { NewLogProbsContentTopLogProbs, NewLogProbsContentTopLogProbs$Outbound } from "./newlogprobscontenttoplogprobs.js"; import { SDKValidationError } from "./sdkvalidationerror.js"; import { UsageInfo, UsageInfo$Outbound } from "./usageinfo.js"; export type CreateCompletionResponseLogprobsNewLogProbsContent = { token?: string | undefined; logprob?: number | undefined; bytes?: Array | undefined; topLogprobs?: Array | undefined; tokenId?: number | undefined; textOffset?: number | undefined; }; export type CreateCompletionResponseLogprobsLogProbs = { 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 CreateCompletionResponseLogprobs = CreateCompletionResponseLogprobsLogProbs | CreateCompletionResponseLogprobsNewLogProbsContent; /** * 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 CreateCompletionResponseFinishReason: { readonly Stop: "stop"; readonly Length: "length"; readonly Error: "error"; }; /** * 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 CreateCompletionResponseFinishReason = ClosedEnum; export type CreateCompletionResponseChoices = { /** * The completion response. */ text: string; /** * The index of the completion choice. */ index: number; /** * The log probabilities of the most likely tokens. */ logprobs: CreateCompletionResponseLogprobsLogProbs | CreateCompletionResponseLogprobsNewLogProbsContent | null; /** * 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: CreateCompletionResponseFinishReason | null; }; export type CreateCompletionResponse = { /** * A unique identifier of the response. */ id: string; /** * The object type, which is always "text_completion". */ object: string; /** * The Unix time in seconds when the response was generated. */ created: number; /** * The model used for the completion. */ model: string; /** * The list of generated 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 CreateCompletionResponseLogprobsNewLogProbsContent$inboundSchema: z.ZodType; /** @internal */ export type CreateCompletionResponseLogprobsNewLogProbsContent$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 CreateCompletionResponseLogprobsNewLogProbsContent$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 CreateCompletionResponseLogprobsNewLogProbsContent$ { /** @deprecated use `CreateCompletionResponseLogprobsNewLogProbsContent$inboundSchema` instead. */ const inboundSchema: z.ZodType; /** @deprecated use `CreateCompletionResponseLogprobsNewLogProbsContent$outboundSchema` instead. */ const outboundSchema: z.ZodType; /** @deprecated use `CreateCompletionResponseLogprobsNewLogProbsContent$Outbound` instead. */ type Outbound = CreateCompletionResponseLogprobsNewLogProbsContent$Outbound; } export declare function createCompletionResponseLogprobsNewLogProbsContentToJSON(createCompletionResponseLogprobsNewLogProbsContent: CreateCompletionResponseLogprobsNewLogProbsContent): string; export declare function createCompletionResponseLogprobsNewLogProbsContentFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const CreateCompletionResponseLogprobsLogProbs$inboundSchema: z.ZodType; /** @internal */ export type CreateCompletionResponseLogprobsLogProbs$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 CreateCompletionResponseLogprobsLogProbs$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 CreateCompletionResponseLogprobsLogProbs$ { /** @deprecated use `CreateCompletionResponseLogprobsLogProbs$inboundSchema` instead. */ const inboundSchema: z.ZodType; /** @deprecated use `CreateCompletionResponseLogprobsLogProbs$outboundSchema` instead. */ const outboundSchema: z.ZodType; /** @deprecated use `CreateCompletionResponseLogprobsLogProbs$Outbound` instead. */ type Outbound = CreateCompletionResponseLogprobsLogProbs$Outbound; } export declare function createCompletionResponseLogprobsLogProbsToJSON(createCompletionResponseLogprobsLogProbs: CreateCompletionResponseLogprobsLogProbs): string; export declare function createCompletionResponseLogprobsLogProbsFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const CreateCompletionResponseLogprobs$inboundSchema: z.ZodType; /** @internal */ export type CreateCompletionResponseLogprobs$Outbound = CreateCompletionResponseLogprobsLogProbs$Outbound | CreateCompletionResponseLogprobsNewLogProbsContent$Outbound; /** @internal */ export declare const CreateCompletionResponseLogprobs$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 CreateCompletionResponseLogprobs$ { /** @deprecated use `CreateCompletionResponseLogprobs$inboundSchema` instead. */ const inboundSchema: z.ZodType; /** @deprecated use `CreateCompletionResponseLogprobs$outboundSchema` instead. */ const outboundSchema: z.ZodType; /** @deprecated use `CreateCompletionResponseLogprobs$Outbound` instead. */ type Outbound = CreateCompletionResponseLogprobs$Outbound; } export declare function createCompletionResponseLogprobsToJSON(createCompletionResponseLogprobs: CreateCompletionResponseLogprobs): string; export declare function createCompletionResponseLogprobsFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const CreateCompletionResponseFinishReason$inboundSchema: z.ZodNativeEnum; /** @internal */ export declare const CreateCompletionResponseFinishReason$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 CreateCompletionResponseFinishReason$ { /** @deprecated use `CreateCompletionResponseFinishReason$inboundSchema` instead. */ const inboundSchema: z.ZodNativeEnum<{ readonly Stop: "stop"; readonly Length: "length"; readonly Error: "error"; }>; /** @deprecated use `CreateCompletionResponseFinishReason$outboundSchema` instead. */ const outboundSchema: z.ZodNativeEnum<{ readonly Stop: "stop"; readonly Length: "length"; readonly Error: "error"; }>; } /** @internal */ export declare const CreateCompletionResponseChoices$inboundSchema: z.ZodType; /** @internal */ export type CreateCompletionResponseChoices$Outbound = { text: string; index: number; logprobs: CreateCompletionResponseLogprobsLogProbs$Outbound | CreateCompletionResponseLogprobsNewLogProbsContent$Outbound | null; finish_reason: string | null; }; /** @internal */ export declare const CreateCompletionResponseChoices$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 CreateCompletionResponseChoices$ { /** @deprecated use `CreateCompletionResponseChoices$inboundSchema` instead. */ const inboundSchema: z.ZodType; /** @deprecated use `CreateCompletionResponseChoices$outboundSchema` instead. */ const outboundSchema: z.ZodType; /** @deprecated use `CreateCompletionResponseChoices$Outbound` instead. */ type Outbound = CreateCompletionResponseChoices$Outbound; } export declare function createCompletionResponseChoicesToJSON(createCompletionResponseChoices: CreateCompletionResponseChoices): string; export declare function createCompletionResponseChoicesFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const CreateCompletionResponse$inboundSchema: z.ZodType; /** @internal */ export type CreateCompletionResponse$Outbound = { id: string; object: string; created: number; model: string; choices: Array; usage?: UsageInfo$Outbound | null | undefined; }; /** @internal */ export declare const CreateCompletionResponse$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 CreateCompletionResponse$ { /** @deprecated use `CreateCompletionResponse$inboundSchema` instead. */ const inboundSchema: z.ZodType; /** @deprecated use `CreateCompletionResponse$outboundSchema` instead. */ const outboundSchema: z.ZodType; /** @deprecated use `CreateCompletionResponse$Outbound` instead. */ type Outbound = CreateCompletionResponse$Outbound; } export declare function createCompletionResponseToJSON(createCompletionResponse: CreateCompletionResponse): string; export declare function createCompletionResponseFromJSON(jsonString: string): SafeParseResult; //# sourceMappingURL=createcompletionresponse.d.ts.map