/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export const AgentTextConfigurationType = { Text: "text", JsonObject: "json_object", } as const; export type AgentTextConfigurationType = ClosedEnum< typeof AgentTextConfigurationType >; export type AgentTextConfigurationFormat = { type?: AgentTextConfigurationType | undefined; }; export const AgentTextConfigurationVerbosity = { Low: "low", Medium: "medium", High: "high", } as const; export type AgentTextConfigurationVerbosity = ClosedEnum< typeof AgentTextConfigurationVerbosity >; export type AgentTextConfiguration = { format?: AgentTextConfigurationFormat | undefined; verbosity?: AgentTextConfigurationVerbosity | undefined; }; /** @internal */ export const AgentTextConfigurationType$inboundSchema: z.ZodNativeEnum< typeof AgentTextConfigurationType > = z.nativeEnum(AgentTextConfigurationType); /** @internal */ export const AgentTextConfigurationType$outboundSchema: z.ZodNativeEnum< typeof AgentTextConfigurationType > = AgentTextConfigurationType$inboundSchema; /** @internal */ export const AgentTextConfigurationFormat$inboundSchema: z.ZodType< AgentTextConfigurationFormat, z.ZodTypeDef, unknown > = z.object({ type: AgentTextConfigurationType$inboundSchema.optional(), }); /** @internal */ export type AgentTextConfigurationFormat$Outbound = { type?: string | undefined; }; /** @internal */ export const AgentTextConfigurationFormat$outboundSchema: z.ZodType< AgentTextConfigurationFormat$Outbound, z.ZodTypeDef, AgentTextConfigurationFormat > = z.object({ type: AgentTextConfigurationType$outboundSchema.optional(), }); export function agentTextConfigurationFormatToJSON( agentTextConfigurationFormat: AgentTextConfigurationFormat, ): string { return JSON.stringify( AgentTextConfigurationFormat$outboundSchema.parse( agentTextConfigurationFormat, ), ); } export function agentTextConfigurationFormatFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AgentTextConfigurationFormat$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AgentTextConfigurationFormat' from JSON`, ); } /** @internal */ export const AgentTextConfigurationVerbosity$inboundSchema: z.ZodNativeEnum< typeof AgentTextConfigurationVerbosity > = z.nativeEnum(AgentTextConfigurationVerbosity); /** @internal */ export const AgentTextConfigurationVerbosity$outboundSchema: z.ZodNativeEnum< typeof AgentTextConfigurationVerbosity > = AgentTextConfigurationVerbosity$inboundSchema; /** @internal */ export const AgentTextConfiguration$inboundSchema: z.ZodType< AgentTextConfiguration, z.ZodTypeDef, unknown > = z.object({ format: z.lazy(() => AgentTextConfigurationFormat$inboundSchema).optional(), verbosity: AgentTextConfigurationVerbosity$inboundSchema.optional(), }); /** @internal */ export type AgentTextConfiguration$Outbound = { format?: AgentTextConfigurationFormat$Outbound | undefined; verbosity?: string | undefined; }; /** @internal */ export const AgentTextConfiguration$outboundSchema: z.ZodType< AgentTextConfiguration$Outbound, z.ZodTypeDef, AgentTextConfiguration > = z.object({ format: z.lazy(() => AgentTextConfigurationFormat$outboundSchema).optional(), verbosity: AgentTextConfigurationVerbosity$outboundSchema.optional(), }); export function agentTextConfigurationToJSON( agentTextConfiguration: AgentTextConfiguration, ): string { return JSON.stringify( AgentTextConfiguration$outboundSchema.parse(agentTextConfiguration), ); } export function agentTextConfigurationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AgentTextConfiguration$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AgentTextConfiguration' from JSON`, ); }