/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Custom tool choice: Forces a specific custom tool by name. */ export type CustomToolChoice = { type: "custom"; name: string; }; /** @internal */ export const CustomToolChoice$inboundSchema: z.ZodType< CustomToolChoice, z.ZodTypeDef, unknown > = z.object({ type: z.literal("custom"), name: z.string(), }); /** @internal */ export type CustomToolChoice$Outbound = { type: "custom"; name: string; }; /** @internal */ export const CustomToolChoice$outboundSchema: z.ZodType< CustomToolChoice$Outbound, z.ZodTypeDef, CustomToolChoice > = z.object({ type: z.literal("custom"), name: z.string(), }); export function customToolChoiceToJSON( customToolChoice: CustomToolChoice, ): string { return JSON.stringify( CustomToolChoice$outboundSchema.parse(customToolChoice), ); } export function customToolChoiceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CustomToolChoice$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CustomToolChoice' from JSON`, ); }