/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: df1371f4f11e
 */
import * as z from "zod/v4";
import { safeParse } from "../../lib/schemas.js";
import { FunctionCall$inboundSchema, FunctionCall$outboundSchema, } from "./functioncall.js";
/** @internal */
export const ToolCall$inboundSchema = z.object({
    id: z.string().default("null"),
    type: z.string().optional(),
    function: FunctionCall$inboundSchema,
    index: z.int().default(0),
});
/** @internal */
export const ToolCall$outboundSchema = z
    .object({
    id: z.string().default("null"),
    type: z.string().optional(),
    function: FunctionCall$outboundSchema,
    index: z.int().default(0),
});
export function toolCallToJSON(toolCall) {
    return JSON.stringify(ToolCall$outboundSchema.parse(toolCall));
}
export function toolCallFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ToolCall$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ToolCall' from JSON`);
}
//# sourceMappingURL=toolcall.js.map