/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: ffab2c2bc0eb
 */
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 { DeltaMessage$inboundSchema } from "./deltamessage.js";
export const CompletionResponseStreamChoiceFinishReason = {
    Stop: "stop",
    Length: "length",
    Error: "error",
    ToolCalls: "tool_calls",
};
/** @internal */
export const CompletionResponseStreamChoiceFinishReason$inboundSchema = openEnums
    .inboundSchema(CompletionResponseStreamChoiceFinishReason);
/** @internal */
export const CompletionResponseStreamChoice$inboundSchema = z.object({
    index: z.int(),
    delta: DeltaMessage$inboundSchema,
    finish_reason: z.nullable(CompletionResponseStreamChoiceFinishReason$inboundSchema),
}).transform((v) => {
    return remap$(v, {
        "finish_reason": "finishReason",
    });
});
export function completionResponseStreamChoiceFromJSON(jsonString) {
    return safeParse(jsonString, (x) => CompletionResponseStreamChoice$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CompletionResponseStreamChoice' from JSON`);
}
//# sourceMappingURL=completionresponsestreamchoice.js.map