/* * 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"; /** * Limits for the embedding model */ export type EmbeddingModelLimits = { /** * Maximum number of inputs allowed in a single batch request */ maxBatchSize: number; /** * Maximum tokens per individual input (derived from contextWindow) */ maxInputTokens: number; /** * Maximum characters per individual input (contextWindow * 2) */ maxInputLength: number; }; /** @internal */ export const EmbeddingModelLimits$inboundSchema: z.ZodType< EmbeddingModelLimits, z.ZodTypeDef, unknown > = z.object({ max_batch_size: z.number(), max_input_tokens: z.number(), max_input_length: z.number(), }).transform((v) => { return remap$(v, { "max_batch_size": "maxBatchSize", "max_input_tokens": "maxInputTokens", "max_input_length": "maxInputLength", }); }); /** @internal */ export type EmbeddingModelLimits$Outbound = { max_batch_size: number; max_input_tokens: number; max_input_length: number; }; /** @internal */ export const EmbeddingModelLimits$outboundSchema: z.ZodType< EmbeddingModelLimits$Outbound, z.ZodTypeDef, EmbeddingModelLimits > = z.object({ maxBatchSize: z.number(), maxInputTokens: z.number(), maxInputLength: z.number(), }).transform((v) => { return remap$(v, { maxBatchSize: "max_batch_size", maxInputTokens: "max_input_tokens", maxInputLength: "max_input_length", }); }); export function embeddingModelLimitsToJSON( embeddingModelLimits: EmbeddingModelLimits, ): string { return JSON.stringify( EmbeddingModelLimits$outboundSchema.parse(embeddingModelLimits), ); } export function embeddingModelLimitsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EmbeddingModelLimits$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EmbeddingModelLimits' from JSON`, ); }