/* * 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"; /** * The default chunking strategy. This strategy currently uses a max_chunk_size_tokens of 800 and chunk_overlap_tokens of 400. */ export type AutoChunkingStrategy = { /** * Always 'auto'. The default chunking strategy. */ type: "auto"; }; /** @internal */ export const AutoChunkingStrategy$inboundSchema: z.ZodType< AutoChunkingStrategy, z.ZodTypeDef, unknown > = z.object({ type: z.literal("auto"), }); /** @internal */ export type AutoChunkingStrategy$Outbound = { type: "auto"; }; /** @internal */ export const AutoChunkingStrategy$outboundSchema: z.ZodType< AutoChunkingStrategy$Outbound, z.ZodTypeDef, AutoChunkingStrategy > = z.object({ type: z.literal("auto"), }); export function autoChunkingStrategyToJSON( autoChunkingStrategy: AutoChunkingStrategy, ): string { return JSON.stringify( AutoChunkingStrategy$outboundSchema.parse(autoChunkingStrategy), ); } export function autoChunkingStrategyFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AutoChunkingStrategy$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AutoChunkingStrategy' from JSON`, ); }