/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 5696bade13cc
 */
import * as z from "zod/v4";
import { remap as remap$ } from "../../lib/primitives.js";
import { safeParse } from "../../lib/schemas.js";
import { smartUnion } from "../../types/smartUnion.js";
import { ChatTranscriptionEvent$inboundSchema, } from "./chattranscriptionevent.js";
/** @internal */
export const ChatCompletionEventExtraFields$inboundSchema = smartUnion([
    z.boolean(),
    z.int(),
    z.number(),
    z.string(),
    z.iso.datetime({ offset: true }).transform(v => new Date(v)),
    z.array(z.string()),
]);
export function chatCompletionEventExtraFieldsFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ChatCompletionEventExtraFields$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ChatCompletionEventExtraFields' from JSON`);
}
/** @internal */
export const ChatCompletionEvent$inboundSchema = z.object({
    event_id: z.string(),
    correlation_id: z.string(),
    created_at: z.iso.datetime({ offset: true }).transform(v => new Date(v)),
    extra_fields: z.record(z.string(), z.nullable(smartUnion([
        z.boolean(),
        z.int(),
        z.number(),
        z.string(),
        z.iso.datetime({ offset: true }).transform(v => new Date(v)),
        z.array(z.string()),
    ]))),
    nb_input_tokens: z.int(),
    nb_output_tokens: z.int(),
    enabled_tools: z.array(z.record(z.string(), z.any())),
    request_messages: z.array(z.record(z.string(), z.any())),
    response_messages: z.array(z.record(z.string(), z.any())),
    nb_messages: z.int(),
    chat_transcription_events: z.array(ChatTranscriptionEvent$inboundSchema),
}).transform((v) => {
    return remap$(v, {
        "event_id": "eventId",
        "correlation_id": "correlationId",
        "created_at": "createdAt",
        "extra_fields": "extraFields",
        "nb_input_tokens": "nbInputTokens",
        "nb_output_tokens": "nbOutputTokens",
        "enabled_tools": "enabledTools",
        "request_messages": "requestMessages",
        "response_messages": "responseMessages",
        "nb_messages": "nbMessages",
        "chat_transcription_events": "chatTranscriptionEvents",
    });
});
export function chatCompletionEventFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ChatCompletionEvent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ChatCompletionEvent' from JSON`);
}
//# sourceMappingURL=chatcompletionevent.js.map