/* * 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"; /** * Function tool choice: Forces a specific function tool by name. */ export type FunctionToolChoice = { type: "function"; name: string; }; /** @internal */ export const FunctionToolChoice$inboundSchema: z.ZodType< FunctionToolChoice, z.ZodTypeDef, unknown > = z.object({ type: z.literal("function"), name: z.string(), }); /** @internal */ export type FunctionToolChoice$Outbound = { type: "function"; name: string; }; /** @internal */ export const FunctionToolChoice$outboundSchema: z.ZodType< FunctionToolChoice$Outbound, z.ZodTypeDef, FunctionToolChoice > = z.object({ type: z.literal("function"), name: z.string(), }); export function functionToolChoiceToJSON( functionToolChoice: FunctionToolChoice, ): string { return JSON.stringify( FunctionToolChoice$outboundSchema.parse(functionToolChoice), ); } export function functionToolChoiceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FunctionToolChoice$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FunctionToolChoice' from JSON`, ); }