/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: e250f9cc1c26
 */
import * as z from "zod/v4";
import { remap as remap$ } from "../../lib/primitives.js";
import { safeParse } from "../../lib/schemas.js";
import * as openEnums from "../../types/enums.js";
import { AssistantMessage$inboundSchema, } from "./assistantmessage.js";
import { DeltaMessage$inboundSchema } from "./deltamessage.js";
export const ChatCompletionChoiceFinishReason = {
    Stop: "stop",
    Length: "length",
    ModelLength: "model_length",
    Error: "error",
    ToolCalls: "tool_calls",
};
/** @internal */
export const ChatCompletionChoiceFinishReason$inboundSchema = openEnums.inboundSchema(ChatCompletionChoiceFinishReason);
/** @internal */
export const ChatCompletionChoice$inboundSchema = z.object({
    index: z.int(),
    message: AssistantMessage$inboundSchema.optional(),
    messages: z.array(DeltaMessage$inboundSchema).optional(),
    finish_reason: ChatCompletionChoiceFinishReason$inboundSchema,
}).transform((v) => {
    return remap$(v, {
        "finish_reason": "finishReason",
    });
});
export function chatCompletionChoiceFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ChatCompletionChoice$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ChatCompletionChoice' from JSON`);
}
//# sourceMappingURL=chatcompletionchoice.js.map