/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { ClosedEnum } from "../types/enums.js"; import { smartUnion } from "../types/smart-union.js"; import { ResponsesNamedToolChoice, ResponsesNamedToolChoice$Outbound, ResponsesNamedToolChoice$outboundSchema, } from "./responses-named-tool-choice.js"; export const ResponsesToolChoiceEnum = { None: "none", Auto: "auto", Required: "required", } as const; export type ResponsesToolChoiceEnum = ClosedEnum< typeof ResponsesToolChoiceEnum >; export type ResponsesToolChoice = | ResponsesNamedToolChoice | ResponsesToolChoiceEnum; /** @internal */ export const ResponsesToolChoiceEnum$outboundSchema: z.ZodMiniEnum< typeof ResponsesToolChoiceEnum > = z.enum(ResponsesToolChoiceEnum); /** @internal */ export type ResponsesToolChoice$Outbound = | ResponsesNamedToolChoice$Outbound | string; /** @internal */ export const ResponsesToolChoice$outboundSchema: z.ZodMiniType< ResponsesToolChoice$Outbound, ResponsesToolChoice > = smartUnion([ ResponsesNamedToolChoice$outboundSchema, ResponsesToolChoiceEnum$outboundSchema, ]); export function responsesToolChoiceToJSON( responsesToolChoice: ResponsesToolChoice, ): string { return JSON.stringify( ResponsesToolChoice$outboundSchema.parse(responsesToolChoice), ); }