/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Custom tool call output item: The output payload returned by a custom tool call. */ export type CustomToolCallOutput = { type: "custom_tool_call_output"; callId: string; output: string; id?: string | undefined; }; /** @internal */ export const CustomToolCallOutput$inboundSchema: z.ZodType< CustomToolCallOutput, z.ZodTypeDef, unknown > = z.object({ type: z.literal("custom_tool_call_output"), call_id: z.string(), output: z.string(), id: z.string().optional(), }).transform((v) => { return remap$(v, { "call_id": "callId", }); }); /** @internal */ export type CustomToolCallOutput$Outbound = { type: "custom_tool_call_output"; call_id: string; output: string; id?: string | undefined; }; /** @internal */ export const CustomToolCallOutput$outboundSchema: z.ZodType< CustomToolCallOutput$Outbound, z.ZodTypeDef, CustomToolCallOutput > = z.object({ type: z.literal("custom_tool_call_output"), callId: z.string(), output: z.string(), id: z.string().optional(), }).transform((v) => { return remap$(v, { callId: "call_id", }); }); export function customToolCallOutputToJSON( customToolCallOutput: CustomToolCallOutput, ): string { return JSON.stringify( CustomToolCallOutput$outboundSchema.parse(customToolCallOutput), ); } export function customToolCallOutputFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CustomToolCallOutput$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CustomToolCallOutput' from JSON`, ); }