@orq-ai/node 3.9.5 → 3.9.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/README.md +91 -86
  2. package/bin/mcp-server.js +1316 -753
  3. package/bin/mcp-server.js.map +32 -29
  4. package/docs/sdks/chunking/README.md +94 -0
  5. package/examples/package-lock.json +1 -1
  6. package/funcs/chunkingParse.d.ts +17 -0
  7. package/funcs/chunkingParse.d.ts.map +1 -0
  8. package/funcs/chunkingParse.js +114 -0
  9. package/funcs/chunkingParse.js.map +1 -0
  10. package/jsr.json +1 -1
  11. package/lib/config.d.ts +2 -2
  12. package/lib/config.js +2 -2
  13. package/mcp-server/mcp-server.js +1 -1
  14. package/mcp-server/server.d.ts.map +1 -1
  15. package/mcp-server/server.js +3 -1
  16. package/mcp-server/server.js.map +1 -1
  17. package/mcp-server/tools/chunkingParse.d.ts +8 -0
  18. package/mcp-server/tools/chunkingParse.d.ts.map +1 -0
  19. package/mcp-server/tools/chunkingParse.js +64 -0
  20. package/mcp-server/tools/chunkingParse.js.map +1 -0
  21. package/models/operations/createcontact.js +2 -2
  22. package/models/operations/createdataset.js +2 -2
  23. package/models/operations/createdatasetitem.js +2 -2
  24. package/models/operations/createdatasource.js +2 -2
  25. package/models/operations/createeval.js +16 -16
  26. package/models/operations/fileget.js +2 -2
  27. package/models/operations/filelist.js +2 -2
  28. package/models/operations/fileupload.js +2 -2
  29. package/models/operations/getevals.js +28 -28
  30. package/models/operations/index.d.ts +1 -0
  31. package/models/operations/index.d.ts.map +1 -1
  32. package/models/operations/index.js +1 -0
  33. package/models/operations/index.js.map +1 -1
  34. package/models/operations/listcontacts.js +2 -2
  35. package/models/operations/listdatasetdatapoints.js +2 -2
  36. package/models/operations/listdatasets.js +2 -2
  37. package/models/operations/listdatasources.js +2 -2
  38. package/models/operations/parse.d.ts +961 -0
  39. package/models/operations/parse.d.ts.map +1 -0
  40. package/models/operations/parse.js +879 -0
  41. package/models/operations/parse.js.map +1 -0
  42. package/models/operations/retrievecontact.js +2 -2
  43. package/models/operations/retrievedatapoint.js +2 -2
  44. package/models/operations/retrievedataset.js +2 -2
  45. package/models/operations/retrievedatasource.js +2 -2
  46. package/models/operations/updatecontact.js +2 -2
  47. package/models/operations/updatedatapoint.js +2 -2
  48. package/models/operations/updatedataset.js +2 -2
  49. package/models/operations/updatedatasource.js +2 -2
  50. package/models/operations/updateeval.js +16 -16
  51. package/package.json +1 -1
  52. package/sdk/chunking.d.ts +12 -0
  53. package/sdk/chunking.d.ts.map +1 -0
  54. package/sdk/chunking.js +22 -0
  55. package/sdk/chunking.js.map +1 -0
  56. package/sdk/sdk.d.ts +3 -0
  57. package/sdk/sdk.d.ts.map +1 -1
  58. package/sdk/sdk.js +4 -0
  59. package/sdk/sdk.js.map +1 -1
  60. package/src/funcs/chunkingParse.ts +160 -0
  61. package/src/lib/config.ts +2 -2
  62. package/src/mcp-server/mcp-server.ts +1 -1
  63. package/src/mcp-server/server.ts +3 -1
  64. package/src/mcp-server/tools/chunkingParse.ts +37 -0
  65. package/src/models/operations/createcontact.ts +2 -2
  66. package/src/models/operations/createdataset.ts +2 -2
  67. package/src/models/operations/createdatasetitem.ts +2 -2
  68. package/src/models/operations/createdatasource.ts +2 -2
  69. package/src/models/operations/createeval.ts +16 -16
  70. package/src/models/operations/fileget.ts +2 -2
  71. package/src/models/operations/filelist.ts +2 -2
  72. package/src/models/operations/fileupload.ts +2 -2
  73. package/src/models/operations/getevals.ts +28 -28
  74. package/src/models/operations/index.ts +1 -0
  75. package/src/models/operations/listcontacts.ts +2 -2
  76. package/src/models/operations/listdatasetdatapoints.ts +2 -2
  77. package/src/models/operations/listdatasets.ts +2 -2
  78. package/src/models/operations/listdatasources.ts +2 -2
  79. package/src/models/operations/parse.ts +1610 -0
  80. package/src/models/operations/retrievecontact.ts +2 -2
  81. package/src/models/operations/retrievedatapoint.ts +2 -2
  82. package/src/models/operations/retrievedataset.ts +2 -2
  83. package/src/models/operations/retrievedatasource.ts +2 -2
  84. package/src/models/operations/updatecontact.ts +2 -2
  85. package/src/models/operations/updatedatapoint.ts +2 -2
  86. package/src/models/operations/updatedataset.ts +2 -2
  87. package/src/models/operations/updatedatasource.ts +2 -2
  88. package/src/models/operations/updateeval.ts +16 -16
  89. package/src/sdk/chunking.ts +27 -0
  90. package/src/sdk/sdk.ts +6 -0
@@ -0,0 +1,1610 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { ClosedEnum } from "../../types/enums.js";
9
+ import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ /**
13
+ * Return format: chunks (with metadata) or texts (plain strings)
14
+ */
15
+ export const ParseChunkingRequestChunkingRequestRequestBodyReturnType = {
16
+ Chunks: "chunks",
17
+ Texts: "texts",
18
+ } as const;
19
+ /**
20
+ * Return format: chunks (with metadata) or texts (plain strings)
21
+ */
22
+ export type ParseChunkingRequestChunkingRequestRequestBodyReturnType =
23
+ ClosedEnum<typeof ParseChunkingRequestChunkingRequestRequestBodyReturnType>;
24
+
25
+ export const AgenticChunker = {
26
+ Agentic: "agentic",
27
+ } as const;
28
+ export type AgenticChunker = ClosedEnum<typeof AgenticChunker>;
29
+
30
+ /**
31
+ * Agentic LLM-powered chunker that uses AI to determine optimal split points. Best for complex documents requiring intelligent segmentation.
32
+ */
33
+ export type AgenticChunkerStrategy = {
34
+ /**
35
+ * The text content to be chunked
36
+ */
37
+ text: string;
38
+ /**
39
+ * Whether to include metadata for each chunk
40
+ */
41
+ metadata?: boolean | undefined;
42
+ /**
43
+ * Return format: chunks (with metadata) or texts (plain strings)
44
+ */
45
+ returnType?:
46
+ | ParseChunkingRequestChunkingRequestRequestBodyReturnType
47
+ | undefined;
48
+ strategy: AgenticChunker;
49
+ /**
50
+ * Chat model to use for chunking. (Available models)[https://docs.orq.ai/docs/proxy#chat-models]
51
+ */
52
+ model: string;
53
+ /**
54
+ * Maximum tokens per chunk
55
+ */
56
+ chunkSize?: number | undefined;
57
+ /**
58
+ * Size of candidate splits for LLM evaluation
59
+ */
60
+ candidateSize?: number | undefined;
61
+ /**
62
+ * Minimum characters allowed per chunk
63
+ */
64
+ minCharactersPerChunk?: number | undefined;
65
+ };
66
+
67
+ /**
68
+ * Return format: chunks (with metadata) or texts (plain strings)
69
+ */
70
+ export const ParseChunkingRequestChunkingRequestReturnType = {
71
+ Chunks: "chunks",
72
+ Texts: "texts",
73
+ } as const;
74
+ /**
75
+ * Return format: chunks (with metadata) or texts (plain strings)
76
+ */
77
+ export type ParseChunkingRequestChunkingRequestReturnType = ClosedEnum<
78
+ typeof ParseChunkingRequestChunkingRequestReturnType
79
+ >;
80
+
81
+ export const SDPMChunker = {
82
+ Sdpm: "sdpm",
83
+ } as const;
84
+ export type SDPMChunker = ClosedEnum<typeof SDPMChunker>;
85
+
86
+ export const ParseThreshold2 = {
87
+ Auto: "auto",
88
+ } as const;
89
+ export type ParseThreshold2 = ClosedEnum<typeof ParseThreshold2>;
90
+
91
+ /**
92
+ * Similarity threshold for grouping (0-1) or "auto" for automatic detection
93
+ */
94
+ export type ChunkingRequestThreshold = number | ParseThreshold2;
95
+
96
+ /**
97
+ * Chunking mode: window-based or sentence-based similarity
98
+ */
99
+ export const ChunkingRequestMode = {
100
+ Window: "window",
101
+ Sentence: "sentence",
102
+ } as const;
103
+ /**
104
+ * Chunking mode: window-based or sentence-based similarity
105
+ */
106
+ export type ChunkingRequestMode = ClosedEnum<typeof ChunkingRequestMode>;
107
+
108
+ /**
109
+ * Sub-Document Prose Model chunker that uses skip-gram patterns to identify optimal split points. Good for technical documents with structured content.
110
+ */
111
+ export type SDPMChunkerStrategy = {
112
+ /**
113
+ * The text content to be chunked
114
+ */
115
+ text: string;
116
+ /**
117
+ * Whether to include metadata for each chunk
118
+ */
119
+ metadata?: boolean | undefined;
120
+ /**
121
+ * Return format: chunks (with metadata) or texts (plain strings)
122
+ */
123
+ returnType?: ParseChunkingRequestChunkingRequestReturnType | undefined;
124
+ strategy: SDPMChunker;
125
+ /**
126
+ * Maximum tokens per chunk
127
+ */
128
+ chunkSize?: number | undefined;
129
+ /**
130
+ * Window size for skip-gram patterns
131
+ */
132
+ skipWindow?: number | undefined;
133
+ /**
134
+ * Similarity threshold for grouping (0-1) or "auto" for automatic detection
135
+ */
136
+ threshold?: number | ParseThreshold2 | undefined;
137
+ /**
138
+ * Embedding model to use for semantic similarity. (Available embedding models)[https://docs.orq.ai/docs/proxy#embedding-models]
139
+ */
140
+ embeddingModel: string;
141
+ /**
142
+ * Chunking mode: window-based or sentence-based similarity
143
+ */
144
+ mode?: ChunkingRequestMode | undefined;
145
+ };
146
+
147
+ /**
148
+ * Return format: chunks (with metadata) or texts (plain strings)
149
+ */
150
+ export const ParseChunkingRequestChunkingReturnType = {
151
+ Chunks: "chunks",
152
+ Texts: "texts",
153
+ } as const;
154
+ /**
155
+ * Return format: chunks (with metadata) or texts (plain strings)
156
+ */
157
+ export type ParseChunkingRequestChunkingReturnType = ClosedEnum<
158
+ typeof ParseChunkingRequestChunkingReturnType
159
+ >;
160
+
161
+ export const SemanticChunker = {
162
+ Semantic: "semantic",
163
+ } as const;
164
+ export type SemanticChunker = ClosedEnum<typeof SemanticChunker>;
165
+
166
+ export const Threshold2 = {
167
+ Auto: "auto",
168
+ } as const;
169
+ export type Threshold2 = ClosedEnum<typeof Threshold2>;
170
+
171
+ /**
172
+ * Similarity threshold for grouping (0-1) or "auto" for automatic detection
173
+ */
174
+ export type Threshold = number | Threshold2;
175
+
176
+ /**
177
+ * Chunking mode: window-based or sentence-based similarity
178
+ */
179
+ export const Mode = {
180
+ Window: "window",
181
+ Sentence: "sentence",
182
+ } as const;
183
+ /**
184
+ * Chunking mode: window-based or sentence-based similarity
185
+ */
186
+ export type Mode = ClosedEnum<typeof Mode>;
187
+
188
+ /**
189
+ * Groups semantically similar sentences using embeddings. Excellent for maintaining topic coherence and context within chunks.
190
+ */
191
+ export type SemanticChunkerStrategy = {
192
+ /**
193
+ * The text content to be chunked
194
+ */
195
+ text: string;
196
+ /**
197
+ * Whether to include metadata for each chunk
198
+ */
199
+ metadata?: boolean | undefined;
200
+ /**
201
+ * Return format: chunks (with metadata) or texts (plain strings)
202
+ */
203
+ returnType?: ParseChunkingRequestChunkingReturnType | undefined;
204
+ strategy: SemanticChunker;
205
+ /**
206
+ * Maximum tokens per chunk
207
+ */
208
+ chunkSize?: number | undefined;
209
+ /**
210
+ * Similarity threshold for grouping (0-1) or "auto" for automatic detection
211
+ */
212
+ threshold?: number | Threshold2 | undefined;
213
+ /**
214
+ * Embedding model to use for semantic similarity. (Available embedding models)[https://docs.orq.ai/docs/proxy#embedding-models]
215
+ */
216
+ embeddingModel: string;
217
+ /**
218
+ * Chunking mode: window-based or sentence-based similarity
219
+ */
220
+ mode?: Mode | undefined;
221
+ /**
222
+ * Window size for similarity comparison
223
+ */
224
+ similarityWindow?: number | undefined;
225
+ };
226
+
227
+ /**
228
+ * Return format: chunks (with metadata) or texts (plain strings)
229
+ */
230
+ export const ParseChunkingRequestReturnType = {
231
+ Chunks: "chunks",
232
+ Texts: "texts",
233
+ } as const;
234
+ /**
235
+ * Return format: chunks (with metadata) or texts (plain strings)
236
+ */
237
+ export type ParseChunkingRequestReturnType = ClosedEnum<
238
+ typeof ParseChunkingRequestReturnType
239
+ >;
240
+
241
+ export const RecursiveChunker = {
242
+ Recursive: "recursive",
243
+ } as const;
244
+ export type RecursiveChunker = ClosedEnum<typeof RecursiveChunker>;
245
+
246
+ /**
247
+ * Recursively splits text using a hierarchy of separators (paragraphs, sentences, words). Versatile general-purpose chunker that preserves document structure.
248
+ */
249
+ export type RecursiveChunkerStrategy = {
250
+ /**
251
+ * The text content to be chunked
252
+ */
253
+ text: string;
254
+ /**
255
+ * Whether to include metadata for each chunk
256
+ */
257
+ metadata?: boolean | undefined;
258
+ /**
259
+ * Return format: chunks (with metadata) or texts (plain strings)
260
+ */
261
+ returnType?: ParseChunkingRequestReturnType | undefined;
262
+ strategy: RecursiveChunker;
263
+ /**
264
+ * Maximum tokens per chunk
265
+ */
266
+ chunkSize?: number | undefined;
267
+ /**
268
+ * Hierarchy of separators to use for splitting
269
+ */
270
+ separators?: Array<string> | undefined;
271
+ /**
272
+ * Minimum characters allowed per chunk
273
+ */
274
+ minCharactersPerChunk?: number | undefined;
275
+ };
276
+
277
+ /**
278
+ * Return format: chunks (with metadata) or texts (plain strings)
279
+ */
280
+ export const ChunkingRequestReturnType = {
281
+ Chunks: "chunks",
282
+ Texts: "texts",
283
+ } as const;
284
+ /**
285
+ * Return format: chunks (with metadata) or texts (plain strings)
286
+ */
287
+ export type ChunkingRequestReturnType = ClosedEnum<
288
+ typeof ChunkingRequestReturnType
289
+ >;
290
+
291
+ export const SentenceChunker = {
292
+ Sentence: "sentence",
293
+ } as const;
294
+ export type SentenceChunker = ClosedEnum<typeof SentenceChunker>;
295
+
296
+ /**
297
+ * Splits text at sentence boundaries while respecting token limits. Ideal for maintaining semantic coherence and readability.
298
+ */
299
+ export type SentenceChunkerStrategy = {
300
+ /**
301
+ * The text content to be chunked
302
+ */
303
+ text: string;
304
+ /**
305
+ * Whether to include metadata for each chunk
306
+ */
307
+ metadata?: boolean | undefined;
308
+ /**
309
+ * Return format: chunks (with metadata) or texts (plain strings)
310
+ */
311
+ returnType?: ChunkingRequestReturnType | undefined;
312
+ strategy: SentenceChunker;
313
+ /**
314
+ * Maximum tokens per chunk
315
+ */
316
+ chunkSize?: number | undefined;
317
+ /**
318
+ * Number of overlapping tokens between chunks
319
+ */
320
+ chunkOverlap?: number | undefined;
321
+ /**
322
+ * Minimum number of sentences per chunk
323
+ */
324
+ minSentencesPerChunk?: number | undefined;
325
+ };
326
+
327
+ /**
328
+ * Return format: chunks (with metadata) or texts (plain strings)
329
+ */
330
+ export const ReturnTypeT = {
331
+ Chunks: "chunks",
332
+ Texts: "texts",
333
+ } as const;
334
+ /**
335
+ * Return format: chunks (with metadata) or texts (plain strings)
336
+ */
337
+ export type ReturnTypeT = ClosedEnum<typeof ReturnTypeT>;
338
+
339
+ export const TokenChunker = {
340
+ Token: "token",
341
+ } as const;
342
+ export type TokenChunker = ClosedEnum<typeof TokenChunker>;
343
+
344
+ /**
345
+ * Splits text based on token count. Best for ensuring chunks fit within LLM context windows and maintaining consistent chunk sizes for embedding models.
346
+ */
347
+ export type TokenChunkerStrategy = {
348
+ /**
349
+ * The text content to be chunked
350
+ */
351
+ text: string;
352
+ /**
353
+ * Whether to include metadata for each chunk
354
+ */
355
+ metadata?: boolean | undefined;
356
+ /**
357
+ * Return format: chunks (with metadata) or texts (plain strings)
358
+ */
359
+ returnType?: ReturnTypeT | undefined;
360
+ strategy: TokenChunker;
361
+ /**
362
+ * Maximum tokens per chunk
363
+ */
364
+ chunkSize?: number | undefined;
365
+ /**
366
+ * Number of tokens to overlap between chunks
367
+ */
368
+ chunkOverlap?: number | undefined;
369
+ };
370
+
371
+ /**
372
+ * Request payload for text chunking with strategy-specific configuration
373
+ */
374
+ export type ParseChunkingRequest =
375
+ | SemanticChunkerStrategy
376
+ | SDPMChunkerStrategy
377
+ | AgenticChunkerStrategy
378
+ | TokenChunkerStrategy
379
+ | SentenceChunkerStrategy
380
+ | RecursiveChunkerStrategy;
381
+
382
+ export type ParseMetadata = {
383
+ startIndex: number | null;
384
+ endIndex: number | null;
385
+ tokenCount: number | null;
386
+ };
387
+
388
+ export type Chunks = {
389
+ /**
390
+ * The text content of the chunk
391
+ */
392
+ text: string;
393
+ /**
394
+ * The position index of this chunk in the sequence
395
+ */
396
+ index: number;
397
+ metadata?: ParseMetadata | undefined;
398
+ };
399
+
400
+ /**
401
+ * Text successfully chunked
402
+ */
403
+ export type ParseResponseBody = {
404
+ chunks: Array<Chunks>;
405
+ };
406
+
407
+ /** @internal */
408
+ export const ParseChunkingRequestChunkingRequestRequestBodyReturnType$inboundSchema:
409
+ z.ZodNativeEnum<
410
+ typeof ParseChunkingRequestChunkingRequestRequestBodyReturnType
411
+ > = z.nativeEnum(ParseChunkingRequestChunkingRequestRequestBodyReturnType);
412
+
413
+ /** @internal */
414
+ export const ParseChunkingRequestChunkingRequestRequestBodyReturnType$outboundSchema:
415
+ z.ZodNativeEnum<
416
+ typeof ParseChunkingRequestChunkingRequestRequestBodyReturnType
417
+ > = ParseChunkingRequestChunkingRequestRequestBodyReturnType$inboundSchema;
418
+
419
+ /**
420
+ * @internal
421
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
422
+ */
423
+ export namespace ParseChunkingRequestChunkingRequestRequestBodyReturnType$ {
424
+ /** @deprecated use `ParseChunkingRequestChunkingRequestRequestBodyReturnType$inboundSchema` instead. */
425
+ export const inboundSchema =
426
+ ParseChunkingRequestChunkingRequestRequestBodyReturnType$inboundSchema;
427
+ /** @deprecated use `ParseChunkingRequestChunkingRequestRequestBodyReturnType$outboundSchema` instead. */
428
+ export const outboundSchema =
429
+ ParseChunkingRequestChunkingRequestRequestBodyReturnType$outboundSchema;
430
+ }
431
+
432
+ /** @internal */
433
+ export const AgenticChunker$inboundSchema: z.ZodNativeEnum<
434
+ typeof AgenticChunker
435
+ > = z.nativeEnum(AgenticChunker);
436
+
437
+ /** @internal */
438
+ export const AgenticChunker$outboundSchema: z.ZodNativeEnum<
439
+ typeof AgenticChunker
440
+ > = AgenticChunker$inboundSchema;
441
+
442
+ /**
443
+ * @internal
444
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
445
+ */
446
+ export namespace AgenticChunker$ {
447
+ /** @deprecated use `AgenticChunker$inboundSchema` instead. */
448
+ export const inboundSchema = AgenticChunker$inboundSchema;
449
+ /** @deprecated use `AgenticChunker$outboundSchema` instead. */
450
+ export const outboundSchema = AgenticChunker$outboundSchema;
451
+ }
452
+
453
+ /** @internal */
454
+ export const AgenticChunkerStrategy$inboundSchema: z.ZodType<
455
+ AgenticChunkerStrategy,
456
+ z.ZodTypeDef,
457
+ unknown
458
+ > = z.object({
459
+ text: z.string(),
460
+ metadata: z.boolean().default(true),
461
+ return_type:
462
+ ParseChunkingRequestChunkingRequestRequestBodyReturnType$inboundSchema
463
+ .default("chunks"),
464
+ strategy: AgenticChunker$inboundSchema,
465
+ model: z.string(),
466
+ chunk_size: z.number().int().default(1024),
467
+ candidate_size: z.number().int().default(128),
468
+ min_characters_per_chunk: z.number().int().default(24),
469
+ }).transform((v) => {
470
+ return remap$(v, {
471
+ "return_type": "returnType",
472
+ "chunk_size": "chunkSize",
473
+ "candidate_size": "candidateSize",
474
+ "min_characters_per_chunk": "minCharactersPerChunk",
475
+ });
476
+ });
477
+
478
+ /** @internal */
479
+ export type AgenticChunkerStrategy$Outbound = {
480
+ text: string;
481
+ metadata: boolean;
482
+ return_type: string;
483
+ strategy: string;
484
+ model: string;
485
+ chunk_size: number;
486
+ candidate_size: number;
487
+ min_characters_per_chunk: number;
488
+ };
489
+
490
+ /** @internal */
491
+ export const AgenticChunkerStrategy$outboundSchema: z.ZodType<
492
+ AgenticChunkerStrategy$Outbound,
493
+ z.ZodTypeDef,
494
+ AgenticChunkerStrategy
495
+ > = z.object({
496
+ text: z.string(),
497
+ metadata: z.boolean().default(true),
498
+ returnType:
499
+ ParseChunkingRequestChunkingRequestRequestBodyReturnType$outboundSchema
500
+ .default("chunks"),
501
+ strategy: AgenticChunker$outboundSchema,
502
+ model: z.string(),
503
+ chunkSize: z.number().int().default(1024),
504
+ candidateSize: z.number().int().default(128),
505
+ minCharactersPerChunk: z.number().int().default(24),
506
+ }).transform((v) => {
507
+ return remap$(v, {
508
+ returnType: "return_type",
509
+ chunkSize: "chunk_size",
510
+ candidateSize: "candidate_size",
511
+ minCharactersPerChunk: "min_characters_per_chunk",
512
+ });
513
+ });
514
+
515
+ /**
516
+ * @internal
517
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
518
+ */
519
+ export namespace AgenticChunkerStrategy$ {
520
+ /** @deprecated use `AgenticChunkerStrategy$inboundSchema` instead. */
521
+ export const inboundSchema = AgenticChunkerStrategy$inboundSchema;
522
+ /** @deprecated use `AgenticChunkerStrategy$outboundSchema` instead. */
523
+ export const outboundSchema = AgenticChunkerStrategy$outboundSchema;
524
+ /** @deprecated use `AgenticChunkerStrategy$Outbound` instead. */
525
+ export type Outbound = AgenticChunkerStrategy$Outbound;
526
+ }
527
+
528
+ export function agenticChunkerStrategyToJSON(
529
+ agenticChunkerStrategy: AgenticChunkerStrategy,
530
+ ): string {
531
+ return JSON.stringify(
532
+ AgenticChunkerStrategy$outboundSchema.parse(agenticChunkerStrategy),
533
+ );
534
+ }
535
+
536
+ export function agenticChunkerStrategyFromJSON(
537
+ jsonString: string,
538
+ ): SafeParseResult<AgenticChunkerStrategy, SDKValidationError> {
539
+ return safeParse(
540
+ jsonString,
541
+ (x) => AgenticChunkerStrategy$inboundSchema.parse(JSON.parse(x)),
542
+ `Failed to parse 'AgenticChunkerStrategy' from JSON`,
543
+ );
544
+ }
545
+
546
+ /** @internal */
547
+ export const ParseChunkingRequestChunkingRequestReturnType$inboundSchema:
548
+ z.ZodNativeEnum<typeof ParseChunkingRequestChunkingRequestReturnType> = z
549
+ .nativeEnum(ParseChunkingRequestChunkingRequestReturnType);
550
+
551
+ /** @internal */
552
+ export const ParseChunkingRequestChunkingRequestReturnType$outboundSchema:
553
+ z.ZodNativeEnum<typeof ParseChunkingRequestChunkingRequestReturnType> =
554
+ ParseChunkingRequestChunkingRequestReturnType$inboundSchema;
555
+
556
+ /**
557
+ * @internal
558
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
559
+ */
560
+ export namespace ParseChunkingRequestChunkingRequestReturnType$ {
561
+ /** @deprecated use `ParseChunkingRequestChunkingRequestReturnType$inboundSchema` instead. */
562
+ export const inboundSchema =
563
+ ParseChunkingRequestChunkingRequestReturnType$inboundSchema;
564
+ /** @deprecated use `ParseChunkingRequestChunkingRequestReturnType$outboundSchema` instead. */
565
+ export const outboundSchema =
566
+ ParseChunkingRequestChunkingRequestReturnType$outboundSchema;
567
+ }
568
+
569
+ /** @internal */
570
+ export const SDPMChunker$inboundSchema: z.ZodNativeEnum<typeof SDPMChunker> = z
571
+ .nativeEnum(SDPMChunker);
572
+
573
+ /** @internal */
574
+ export const SDPMChunker$outboundSchema: z.ZodNativeEnum<typeof SDPMChunker> =
575
+ SDPMChunker$inboundSchema;
576
+
577
+ /**
578
+ * @internal
579
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
580
+ */
581
+ export namespace SDPMChunker$ {
582
+ /** @deprecated use `SDPMChunker$inboundSchema` instead. */
583
+ export const inboundSchema = SDPMChunker$inboundSchema;
584
+ /** @deprecated use `SDPMChunker$outboundSchema` instead. */
585
+ export const outboundSchema = SDPMChunker$outboundSchema;
586
+ }
587
+
588
+ /** @internal */
589
+ export const ParseThreshold2$inboundSchema: z.ZodNativeEnum<
590
+ typeof ParseThreshold2
591
+ > = z.nativeEnum(ParseThreshold2);
592
+
593
+ /** @internal */
594
+ export const ParseThreshold2$outboundSchema: z.ZodNativeEnum<
595
+ typeof ParseThreshold2
596
+ > = ParseThreshold2$inboundSchema;
597
+
598
+ /**
599
+ * @internal
600
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
601
+ */
602
+ export namespace ParseThreshold2$ {
603
+ /** @deprecated use `ParseThreshold2$inboundSchema` instead. */
604
+ export const inboundSchema = ParseThreshold2$inboundSchema;
605
+ /** @deprecated use `ParseThreshold2$outboundSchema` instead. */
606
+ export const outboundSchema = ParseThreshold2$outboundSchema;
607
+ }
608
+
609
+ /** @internal */
610
+ export const ChunkingRequestThreshold$inboundSchema: z.ZodType<
611
+ ChunkingRequestThreshold,
612
+ z.ZodTypeDef,
613
+ unknown
614
+ > = z.union([z.number(), ParseThreshold2$inboundSchema]);
615
+
616
+ /** @internal */
617
+ export type ChunkingRequestThreshold$Outbound = number | string;
618
+
619
+ /** @internal */
620
+ export const ChunkingRequestThreshold$outboundSchema: z.ZodType<
621
+ ChunkingRequestThreshold$Outbound,
622
+ z.ZodTypeDef,
623
+ ChunkingRequestThreshold
624
+ > = z.union([z.number(), ParseThreshold2$outboundSchema]);
625
+
626
+ /**
627
+ * @internal
628
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
629
+ */
630
+ export namespace ChunkingRequestThreshold$ {
631
+ /** @deprecated use `ChunkingRequestThreshold$inboundSchema` instead. */
632
+ export const inboundSchema = ChunkingRequestThreshold$inboundSchema;
633
+ /** @deprecated use `ChunkingRequestThreshold$outboundSchema` instead. */
634
+ export const outboundSchema = ChunkingRequestThreshold$outboundSchema;
635
+ /** @deprecated use `ChunkingRequestThreshold$Outbound` instead. */
636
+ export type Outbound = ChunkingRequestThreshold$Outbound;
637
+ }
638
+
639
+ export function chunkingRequestThresholdToJSON(
640
+ chunkingRequestThreshold: ChunkingRequestThreshold,
641
+ ): string {
642
+ return JSON.stringify(
643
+ ChunkingRequestThreshold$outboundSchema.parse(chunkingRequestThreshold),
644
+ );
645
+ }
646
+
647
+ export function chunkingRequestThresholdFromJSON(
648
+ jsonString: string,
649
+ ): SafeParseResult<ChunkingRequestThreshold, SDKValidationError> {
650
+ return safeParse(
651
+ jsonString,
652
+ (x) => ChunkingRequestThreshold$inboundSchema.parse(JSON.parse(x)),
653
+ `Failed to parse 'ChunkingRequestThreshold' from JSON`,
654
+ );
655
+ }
656
+
657
+ /** @internal */
658
+ export const ChunkingRequestMode$inboundSchema: z.ZodNativeEnum<
659
+ typeof ChunkingRequestMode
660
+ > = z.nativeEnum(ChunkingRequestMode);
661
+
662
+ /** @internal */
663
+ export const ChunkingRequestMode$outboundSchema: z.ZodNativeEnum<
664
+ typeof ChunkingRequestMode
665
+ > = ChunkingRequestMode$inboundSchema;
666
+
667
+ /**
668
+ * @internal
669
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
670
+ */
671
+ export namespace ChunkingRequestMode$ {
672
+ /** @deprecated use `ChunkingRequestMode$inboundSchema` instead. */
673
+ export const inboundSchema = ChunkingRequestMode$inboundSchema;
674
+ /** @deprecated use `ChunkingRequestMode$outboundSchema` instead. */
675
+ export const outboundSchema = ChunkingRequestMode$outboundSchema;
676
+ }
677
+
678
+ /** @internal */
679
+ export const SDPMChunkerStrategy$inboundSchema: z.ZodType<
680
+ SDPMChunkerStrategy,
681
+ z.ZodTypeDef,
682
+ unknown
683
+ > = z.object({
684
+ text: z.string(),
685
+ metadata: z.boolean().default(true),
686
+ return_type: ParseChunkingRequestChunkingRequestReturnType$inboundSchema
687
+ .default("chunks"),
688
+ strategy: SDPMChunker$inboundSchema,
689
+ chunk_size: z.number().int().default(512),
690
+ skip_window: z.number().int().default(1),
691
+ threshold: z.union([z.number(), ParseThreshold2$inboundSchema]).optional(),
692
+ embedding_model: z.string(),
693
+ mode: ChunkingRequestMode$inboundSchema.default("window"),
694
+ }).transform((v) => {
695
+ return remap$(v, {
696
+ "return_type": "returnType",
697
+ "chunk_size": "chunkSize",
698
+ "skip_window": "skipWindow",
699
+ "embedding_model": "embeddingModel",
700
+ });
701
+ });
702
+
703
+ /** @internal */
704
+ export type SDPMChunkerStrategy$Outbound = {
705
+ text: string;
706
+ metadata: boolean;
707
+ return_type: string;
708
+ strategy: string;
709
+ chunk_size: number;
710
+ skip_window: number;
711
+ threshold?: number | string | undefined;
712
+ embedding_model: string;
713
+ mode: string;
714
+ };
715
+
716
+ /** @internal */
717
+ export const SDPMChunkerStrategy$outboundSchema: z.ZodType<
718
+ SDPMChunkerStrategy$Outbound,
719
+ z.ZodTypeDef,
720
+ SDPMChunkerStrategy
721
+ > = z.object({
722
+ text: z.string(),
723
+ metadata: z.boolean().default(true),
724
+ returnType: ParseChunkingRequestChunkingRequestReturnType$outboundSchema
725
+ .default("chunks"),
726
+ strategy: SDPMChunker$outboundSchema,
727
+ chunkSize: z.number().int().default(512),
728
+ skipWindow: z.number().int().default(1),
729
+ threshold: z.union([z.number(), ParseThreshold2$outboundSchema]).optional(),
730
+ embeddingModel: z.string(),
731
+ mode: ChunkingRequestMode$outboundSchema.default("window"),
732
+ }).transform((v) => {
733
+ return remap$(v, {
734
+ returnType: "return_type",
735
+ chunkSize: "chunk_size",
736
+ skipWindow: "skip_window",
737
+ embeddingModel: "embedding_model",
738
+ });
739
+ });
740
+
741
+ /**
742
+ * @internal
743
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
744
+ */
745
+ export namespace SDPMChunkerStrategy$ {
746
+ /** @deprecated use `SDPMChunkerStrategy$inboundSchema` instead. */
747
+ export const inboundSchema = SDPMChunkerStrategy$inboundSchema;
748
+ /** @deprecated use `SDPMChunkerStrategy$outboundSchema` instead. */
749
+ export const outboundSchema = SDPMChunkerStrategy$outboundSchema;
750
+ /** @deprecated use `SDPMChunkerStrategy$Outbound` instead. */
751
+ export type Outbound = SDPMChunkerStrategy$Outbound;
752
+ }
753
+
754
+ export function sdpmChunkerStrategyToJSON(
755
+ sdpmChunkerStrategy: SDPMChunkerStrategy,
756
+ ): string {
757
+ return JSON.stringify(
758
+ SDPMChunkerStrategy$outboundSchema.parse(sdpmChunkerStrategy),
759
+ );
760
+ }
761
+
762
+ export function sdpmChunkerStrategyFromJSON(
763
+ jsonString: string,
764
+ ): SafeParseResult<SDPMChunkerStrategy, SDKValidationError> {
765
+ return safeParse(
766
+ jsonString,
767
+ (x) => SDPMChunkerStrategy$inboundSchema.parse(JSON.parse(x)),
768
+ `Failed to parse 'SDPMChunkerStrategy' from JSON`,
769
+ );
770
+ }
771
+
772
+ /** @internal */
773
+ export const ParseChunkingRequestChunkingReturnType$inboundSchema:
774
+ z.ZodNativeEnum<typeof ParseChunkingRequestChunkingReturnType> = z.nativeEnum(
775
+ ParseChunkingRequestChunkingReturnType,
776
+ );
777
+
778
+ /** @internal */
779
+ export const ParseChunkingRequestChunkingReturnType$outboundSchema:
780
+ z.ZodNativeEnum<typeof ParseChunkingRequestChunkingReturnType> =
781
+ ParseChunkingRequestChunkingReturnType$inboundSchema;
782
+
783
+ /**
784
+ * @internal
785
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
786
+ */
787
+ export namespace ParseChunkingRequestChunkingReturnType$ {
788
+ /** @deprecated use `ParseChunkingRequestChunkingReturnType$inboundSchema` instead. */
789
+ export const inboundSchema =
790
+ ParseChunkingRequestChunkingReturnType$inboundSchema;
791
+ /** @deprecated use `ParseChunkingRequestChunkingReturnType$outboundSchema` instead. */
792
+ export const outboundSchema =
793
+ ParseChunkingRequestChunkingReturnType$outboundSchema;
794
+ }
795
+
796
+ /** @internal */
797
+ export const SemanticChunker$inboundSchema: z.ZodNativeEnum<
798
+ typeof SemanticChunker
799
+ > = z.nativeEnum(SemanticChunker);
800
+
801
+ /** @internal */
802
+ export const SemanticChunker$outboundSchema: z.ZodNativeEnum<
803
+ typeof SemanticChunker
804
+ > = SemanticChunker$inboundSchema;
805
+
806
+ /**
807
+ * @internal
808
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
809
+ */
810
+ export namespace SemanticChunker$ {
811
+ /** @deprecated use `SemanticChunker$inboundSchema` instead. */
812
+ export const inboundSchema = SemanticChunker$inboundSchema;
813
+ /** @deprecated use `SemanticChunker$outboundSchema` instead. */
814
+ export const outboundSchema = SemanticChunker$outboundSchema;
815
+ }
816
+
817
+ /** @internal */
818
+ export const Threshold2$inboundSchema: z.ZodNativeEnum<typeof Threshold2> = z
819
+ .nativeEnum(Threshold2);
820
+
821
+ /** @internal */
822
+ export const Threshold2$outboundSchema: z.ZodNativeEnum<typeof Threshold2> =
823
+ Threshold2$inboundSchema;
824
+
825
+ /**
826
+ * @internal
827
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
828
+ */
829
+ export namespace Threshold2$ {
830
+ /** @deprecated use `Threshold2$inboundSchema` instead. */
831
+ export const inboundSchema = Threshold2$inboundSchema;
832
+ /** @deprecated use `Threshold2$outboundSchema` instead. */
833
+ export const outboundSchema = Threshold2$outboundSchema;
834
+ }
835
+
836
+ /** @internal */
837
+ export const Threshold$inboundSchema: z.ZodType<
838
+ Threshold,
839
+ z.ZodTypeDef,
840
+ unknown
841
+ > = z.union([z.number(), Threshold2$inboundSchema]);
842
+
843
+ /** @internal */
844
+ export type Threshold$Outbound = number | string;
845
+
846
+ /** @internal */
847
+ export const Threshold$outboundSchema: z.ZodType<
848
+ Threshold$Outbound,
849
+ z.ZodTypeDef,
850
+ Threshold
851
+ > = z.union([z.number(), Threshold2$outboundSchema]);
852
+
853
+ /**
854
+ * @internal
855
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
856
+ */
857
+ export namespace Threshold$ {
858
+ /** @deprecated use `Threshold$inboundSchema` instead. */
859
+ export const inboundSchema = Threshold$inboundSchema;
860
+ /** @deprecated use `Threshold$outboundSchema` instead. */
861
+ export const outboundSchema = Threshold$outboundSchema;
862
+ /** @deprecated use `Threshold$Outbound` instead. */
863
+ export type Outbound = Threshold$Outbound;
864
+ }
865
+
866
+ export function thresholdToJSON(threshold: Threshold): string {
867
+ return JSON.stringify(Threshold$outboundSchema.parse(threshold));
868
+ }
869
+
870
+ export function thresholdFromJSON(
871
+ jsonString: string,
872
+ ): SafeParseResult<Threshold, SDKValidationError> {
873
+ return safeParse(
874
+ jsonString,
875
+ (x) => Threshold$inboundSchema.parse(JSON.parse(x)),
876
+ `Failed to parse 'Threshold' from JSON`,
877
+ );
878
+ }
879
+
880
+ /** @internal */
881
+ export const Mode$inboundSchema: z.ZodNativeEnum<typeof Mode> = z.nativeEnum(
882
+ Mode,
883
+ );
884
+
885
+ /** @internal */
886
+ export const Mode$outboundSchema: z.ZodNativeEnum<typeof Mode> =
887
+ Mode$inboundSchema;
888
+
889
+ /**
890
+ * @internal
891
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
892
+ */
893
+ export namespace Mode$ {
894
+ /** @deprecated use `Mode$inboundSchema` instead. */
895
+ export const inboundSchema = Mode$inboundSchema;
896
+ /** @deprecated use `Mode$outboundSchema` instead. */
897
+ export const outboundSchema = Mode$outboundSchema;
898
+ }
899
+
900
+ /** @internal */
901
+ export const SemanticChunkerStrategy$inboundSchema: z.ZodType<
902
+ SemanticChunkerStrategy,
903
+ z.ZodTypeDef,
904
+ unknown
905
+ > = z.object({
906
+ text: z.string(),
907
+ metadata: z.boolean().default(true),
908
+ return_type: ParseChunkingRequestChunkingReturnType$inboundSchema.default(
909
+ "chunks",
910
+ ),
911
+ strategy: SemanticChunker$inboundSchema,
912
+ chunk_size: z.number().int().default(512),
913
+ threshold: z.union([z.number(), Threshold2$inboundSchema]).optional(),
914
+ embedding_model: z.string(),
915
+ mode: Mode$inboundSchema.default("window"),
916
+ similarity_window: z.number().int().default(1),
917
+ }).transform((v) => {
918
+ return remap$(v, {
919
+ "return_type": "returnType",
920
+ "chunk_size": "chunkSize",
921
+ "embedding_model": "embeddingModel",
922
+ "similarity_window": "similarityWindow",
923
+ });
924
+ });
925
+
926
+ /** @internal */
927
+ export type SemanticChunkerStrategy$Outbound = {
928
+ text: string;
929
+ metadata: boolean;
930
+ return_type: string;
931
+ strategy: string;
932
+ chunk_size: number;
933
+ threshold?: number | string | undefined;
934
+ embedding_model: string;
935
+ mode: string;
936
+ similarity_window: number;
937
+ };
938
+
939
+ /** @internal */
940
+ export const SemanticChunkerStrategy$outboundSchema: z.ZodType<
941
+ SemanticChunkerStrategy$Outbound,
942
+ z.ZodTypeDef,
943
+ SemanticChunkerStrategy
944
+ > = z.object({
945
+ text: z.string(),
946
+ metadata: z.boolean().default(true),
947
+ returnType: ParseChunkingRequestChunkingReturnType$outboundSchema.default(
948
+ "chunks",
949
+ ),
950
+ strategy: SemanticChunker$outboundSchema,
951
+ chunkSize: z.number().int().default(512),
952
+ threshold: z.union([z.number(), Threshold2$outboundSchema]).optional(),
953
+ embeddingModel: z.string(),
954
+ mode: Mode$outboundSchema.default("window"),
955
+ similarityWindow: z.number().int().default(1),
956
+ }).transform((v) => {
957
+ return remap$(v, {
958
+ returnType: "return_type",
959
+ chunkSize: "chunk_size",
960
+ embeddingModel: "embedding_model",
961
+ similarityWindow: "similarity_window",
962
+ });
963
+ });
964
+
965
+ /**
966
+ * @internal
967
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
968
+ */
969
+ export namespace SemanticChunkerStrategy$ {
970
+ /** @deprecated use `SemanticChunkerStrategy$inboundSchema` instead. */
971
+ export const inboundSchema = SemanticChunkerStrategy$inboundSchema;
972
+ /** @deprecated use `SemanticChunkerStrategy$outboundSchema` instead. */
973
+ export const outboundSchema = SemanticChunkerStrategy$outboundSchema;
974
+ /** @deprecated use `SemanticChunkerStrategy$Outbound` instead. */
975
+ export type Outbound = SemanticChunkerStrategy$Outbound;
976
+ }
977
+
978
+ export function semanticChunkerStrategyToJSON(
979
+ semanticChunkerStrategy: SemanticChunkerStrategy,
980
+ ): string {
981
+ return JSON.stringify(
982
+ SemanticChunkerStrategy$outboundSchema.parse(semanticChunkerStrategy),
983
+ );
984
+ }
985
+
986
+ export function semanticChunkerStrategyFromJSON(
987
+ jsonString: string,
988
+ ): SafeParseResult<SemanticChunkerStrategy, SDKValidationError> {
989
+ return safeParse(
990
+ jsonString,
991
+ (x) => SemanticChunkerStrategy$inboundSchema.parse(JSON.parse(x)),
992
+ `Failed to parse 'SemanticChunkerStrategy' from JSON`,
993
+ );
994
+ }
995
+
996
+ /** @internal */
997
+ export const ParseChunkingRequestReturnType$inboundSchema: z.ZodNativeEnum<
998
+ typeof ParseChunkingRequestReturnType
999
+ > = z.nativeEnum(ParseChunkingRequestReturnType);
1000
+
1001
+ /** @internal */
1002
+ export const ParseChunkingRequestReturnType$outboundSchema: z.ZodNativeEnum<
1003
+ typeof ParseChunkingRequestReturnType
1004
+ > = ParseChunkingRequestReturnType$inboundSchema;
1005
+
1006
+ /**
1007
+ * @internal
1008
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1009
+ */
1010
+ export namespace ParseChunkingRequestReturnType$ {
1011
+ /** @deprecated use `ParseChunkingRequestReturnType$inboundSchema` instead. */
1012
+ export const inboundSchema = ParseChunkingRequestReturnType$inboundSchema;
1013
+ /** @deprecated use `ParseChunkingRequestReturnType$outboundSchema` instead. */
1014
+ export const outboundSchema = ParseChunkingRequestReturnType$outboundSchema;
1015
+ }
1016
+
1017
+ /** @internal */
1018
+ export const RecursiveChunker$inboundSchema: z.ZodNativeEnum<
1019
+ typeof RecursiveChunker
1020
+ > = z.nativeEnum(RecursiveChunker);
1021
+
1022
+ /** @internal */
1023
+ export const RecursiveChunker$outboundSchema: z.ZodNativeEnum<
1024
+ typeof RecursiveChunker
1025
+ > = RecursiveChunker$inboundSchema;
1026
+
1027
+ /**
1028
+ * @internal
1029
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1030
+ */
1031
+ export namespace RecursiveChunker$ {
1032
+ /** @deprecated use `RecursiveChunker$inboundSchema` instead. */
1033
+ export const inboundSchema = RecursiveChunker$inboundSchema;
1034
+ /** @deprecated use `RecursiveChunker$outboundSchema` instead. */
1035
+ export const outboundSchema = RecursiveChunker$outboundSchema;
1036
+ }
1037
+
1038
+ /** @internal */
1039
+ export const RecursiveChunkerStrategy$inboundSchema: z.ZodType<
1040
+ RecursiveChunkerStrategy,
1041
+ z.ZodTypeDef,
1042
+ unknown
1043
+ > = z.object({
1044
+ text: z.string(),
1045
+ metadata: z.boolean().default(true),
1046
+ return_type: ParseChunkingRequestReturnType$inboundSchema.default("chunks"),
1047
+ strategy: RecursiveChunker$inboundSchema,
1048
+ chunk_size: z.number().int().default(512),
1049
+ separators: z.array(z.string()).optional(),
1050
+ min_characters_per_chunk: z.number().int().default(24),
1051
+ }).transform((v) => {
1052
+ return remap$(v, {
1053
+ "return_type": "returnType",
1054
+ "chunk_size": "chunkSize",
1055
+ "min_characters_per_chunk": "minCharactersPerChunk",
1056
+ });
1057
+ });
1058
+
1059
+ /** @internal */
1060
+ export type RecursiveChunkerStrategy$Outbound = {
1061
+ text: string;
1062
+ metadata: boolean;
1063
+ return_type: string;
1064
+ strategy: string;
1065
+ chunk_size: number;
1066
+ separators?: Array<string> | undefined;
1067
+ min_characters_per_chunk: number;
1068
+ };
1069
+
1070
+ /** @internal */
1071
+ export const RecursiveChunkerStrategy$outboundSchema: z.ZodType<
1072
+ RecursiveChunkerStrategy$Outbound,
1073
+ z.ZodTypeDef,
1074
+ RecursiveChunkerStrategy
1075
+ > = z.object({
1076
+ text: z.string(),
1077
+ metadata: z.boolean().default(true),
1078
+ returnType: ParseChunkingRequestReturnType$outboundSchema.default("chunks"),
1079
+ strategy: RecursiveChunker$outboundSchema,
1080
+ chunkSize: z.number().int().default(512),
1081
+ separators: z.array(z.string()).optional(),
1082
+ minCharactersPerChunk: z.number().int().default(24),
1083
+ }).transform((v) => {
1084
+ return remap$(v, {
1085
+ returnType: "return_type",
1086
+ chunkSize: "chunk_size",
1087
+ minCharactersPerChunk: "min_characters_per_chunk",
1088
+ });
1089
+ });
1090
+
1091
+ /**
1092
+ * @internal
1093
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1094
+ */
1095
+ export namespace RecursiveChunkerStrategy$ {
1096
+ /** @deprecated use `RecursiveChunkerStrategy$inboundSchema` instead. */
1097
+ export const inboundSchema = RecursiveChunkerStrategy$inboundSchema;
1098
+ /** @deprecated use `RecursiveChunkerStrategy$outboundSchema` instead. */
1099
+ export const outboundSchema = RecursiveChunkerStrategy$outboundSchema;
1100
+ /** @deprecated use `RecursiveChunkerStrategy$Outbound` instead. */
1101
+ export type Outbound = RecursiveChunkerStrategy$Outbound;
1102
+ }
1103
+
1104
+ export function recursiveChunkerStrategyToJSON(
1105
+ recursiveChunkerStrategy: RecursiveChunkerStrategy,
1106
+ ): string {
1107
+ return JSON.stringify(
1108
+ RecursiveChunkerStrategy$outboundSchema.parse(recursiveChunkerStrategy),
1109
+ );
1110
+ }
1111
+
1112
+ export function recursiveChunkerStrategyFromJSON(
1113
+ jsonString: string,
1114
+ ): SafeParseResult<RecursiveChunkerStrategy, SDKValidationError> {
1115
+ return safeParse(
1116
+ jsonString,
1117
+ (x) => RecursiveChunkerStrategy$inboundSchema.parse(JSON.parse(x)),
1118
+ `Failed to parse 'RecursiveChunkerStrategy' from JSON`,
1119
+ );
1120
+ }
1121
+
1122
+ /** @internal */
1123
+ export const ChunkingRequestReturnType$inboundSchema: z.ZodNativeEnum<
1124
+ typeof ChunkingRequestReturnType
1125
+ > = z.nativeEnum(ChunkingRequestReturnType);
1126
+
1127
+ /** @internal */
1128
+ export const ChunkingRequestReturnType$outboundSchema: z.ZodNativeEnum<
1129
+ typeof ChunkingRequestReturnType
1130
+ > = ChunkingRequestReturnType$inboundSchema;
1131
+
1132
+ /**
1133
+ * @internal
1134
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1135
+ */
1136
+ export namespace ChunkingRequestReturnType$ {
1137
+ /** @deprecated use `ChunkingRequestReturnType$inboundSchema` instead. */
1138
+ export const inboundSchema = ChunkingRequestReturnType$inboundSchema;
1139
+ /** @deprecated use `ChunkingRequestReturnType$outboundSchema` instead. */
1140
+ export const outboundSchema = ChunkingRequestReturnType$outboundSchema;
1141
+ }
1142
+
1143
+ /** @internal */
1144
+ export const SentenceChunker$inboundSchema: z.ZodNativeEnum<
1145
+ typeof SentenceChunker
1146
+ > = z.nativeEnum(SentenceChunker);
1147
+
1148
+ /** @internal */
1149
+ export const SentenceChunker$outboundSchema: z.ZodNativeEnum<
1150
+ typeof SentenceChunker
1151
+ > = SentenceChunker$inboundSchema;
1152
+
1153
+ /**
1154
+ * @internal
1155
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1156
+ */
1157
+ export namespace SentenceChunker$ {
1158
+ /** @deprecated use `SentenceChunker$inboundSchema` instead. */
1159
+ export const inboundSchema = SentenceChunker$inboundSchema;
1160
+ /** @deprecated use `SentenceChunker$outboundSchema` instead. */
1161
+ export const outboundSchema = SentenceChunker$outboundSchema;
1162
+ }
1163
+
1164
+ /** @internal */
1165
+ export const SentenceChunkerStrategy$inboundSchema: z.ZodType<
1166
+ SentenceChunkerStrategy,
1167
+ z.ZodTypeDef,
1168
+ unknown
1169
+ > = z.object({
1170
+ text: z.string(),
1171
+ metadata: z.boolean().default(true),
1172
+ return_type: ChunkingRequestReturnType$inboundSchema.default("chunks"),
1173
+ strategy: SentenceChunker$inboundSchema,
1174
+ chunk_size: z.number().int().default(512),
1175
+ chunk_overlap: z.number().int().default(0),
1176
+ min_sentences_per_chunk: z.number().int().default(1),
1177
+ }).transform((v) => {
1178
+ return remap$(v, {
1179
+ "return_type": "returnType",
1180
+ "chunk_size": "chunkSize",
1181
+ "chunk_overlap": "chunkOverlap",
1182
+ "min_sentences_per_chunk": "minSentencesPerChunk",
1183
+ });
1184
+ });
1185
+
1186
+ /** @internal */
1187
+ export type SentenceChunkerStrategy$Outbound = {
1188
+ text: string;
1189
+ metadata: boolean;
1190
+ return_type: string;
1191
+ strategy: string;
1192
+ chunk_size: number;
1193
+ chunk_overlap: number;
1194
+ min_sentences_per_chunk: number;
1195
+ };
1196
+
1197
+ /** @internal */
1198
+ export const SentenceChunkerStrategy$outboundSchema: z.ZodType<
1199
+ SentenceChunkerStrategy$Outbound,
1200
+ z.ZodTypeDef,
1201
+ SentenceChunkerStrategy
1202
+ > = z.object({
1203
+ text: z.string(),
1204
+ metadata: z.boolean().default(true),
1205
+ returnType: ChunkingRequestReturnType$outboundSchema.default("chunks"),
1206
+ strategy: SentenceChunker$outboundSchema,
1207
+ chunkSize: z.number().int().default(512),
1208
+ chunkOverlap: z.number().int().default(0),
1209
+ minSentencesPerChunk: z.number().int().default(1),
1210
+ }).transform((v) => {
1211
+ return remap$(v, {
1212
+ returnType: "return_type",
1213
+ chunkSize: "chunk_size",
1214
+ chunkOverlap: "chunk_overlap",
1215
+ minSentencesPerChunk: "min_sentences_per_chunk",
1216
+ });
1217
+ });
1218
+
1219
+ /**
1220
+ * @internal
1221
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1222
+ */
1223
+ export namespace SentenceChunkerStrategy$ {
1224
+ /** @deprecated use `SentenceChunkerStrategy$inboundSchema` instead. */
1225
+ export const inboundSchema = SentenceChunkerStrategy$inboundSchema;
1226
+ /** @deprecated use `SentenceChunkerStrategy$outboundSchema` instead. */
1227
+ export const outboundSchema = SentenceChunkerStrategy$outboundSchema;
1228
+ /** @deprecated use `SentenceChunkerStrategy$Outbound` instead. */
1229
+ export type Outbound = SentenceChunkerStrategy$Outbound;
1230
+ }
1231
+
1232
+ export function sentenceChunkerStrategyToJSON(
1233
+ sentenceChunkerStrategy: SentenceChunkerStrategy,
1234
+ ): string {
1235
+ return JSON.stringify(
1236
+ SentenceChunkerStrategy$outboundSchema.parse(sentenceChunkerStrategy),
1237
+ );
1238
+ }
1239
+
1240
+ export function sentenceChunkerStrategyFromJSON(
1241
+ jsonString: string,
1242
+ ): SafeParseResult<SentenceChunkerStrategy, SDKValidationError> {
1243
+ return safeParse(
1244
+ jsonString,
1245
+ (x) => SentenceChunkerStrategy$inboundSchema.parse(JSON.parse(x)),
1246
+ `Failed to parse 'SentenceChunkerStrategy' from JSON`,
1247
+ );
1248
+ }
1249
+
1250
+ /** @internal */
1251
+ export const ReturnTypeT$inboundSchema: z.ZodNativeEnum<typeof ReturnTypeT> = z
1252
+ .nativeEnum(ReturnTypeT);
1253
+
1254
+ /** @internal */
1255
+ export const ReturnTypeT$outboundSchema: z.ZodNativeEnum<typeof ReturnTypeT> =
1256
+ ReturnTypeT$inboundSchema;
1257
+
1258
+ /**
1259
+ * @internal
1260
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1261
+ */
1262
+ export namespace ReturnTypeT$ {
1263
+ /** @deprecated use `ReturnTypeT$inboundSchema` instead. */
1264
+ export const inboundSchema = ReturnTypeT$inboundSchema;
1265
+ /** @deprecated use `ReturnTypeT$outboundSchema` instead. */
1266
+ export const outboundSchema = ReturnTypeT$outboundSchema;
1267
+ }
1268
+
1269
+ /** @internal */
1270
+ export const TokenChunker$inboundSchema: z.ZodNativeEnum<typeof TokenChunker> =
1271
+ z.nativeEnum(TokenChunker);
1272
+
1273
+ /** @internal */
1274
+ export const TokenChunker$outboundSchema: z.ZodNativeEnum<typeof TokenChunker> =
1275
+ TokenChunker$inboundSchema;
1276
+
1277
+ /**
1278
+ * @internal
1279
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1280
+ */
1281
+ export namespace TokenChunker$ {
1282
+ /** @deprecated use `TokenChunker$inboundSchema` instead. */
1283
+ export const inboundSchema = TokenChunker$inboundSchema;
1284
+ /** @deprecated use `TokenChunker$outboundSchema` instead. */
1285
+ export const outboundSchema = TokenChunker$outboundSchema;
1286
+ }
1287
+
1288
+ /** @internal */
1289
+ export const TokenChunkerStrategy$inboundSchema: z.ZodType<
1290
+ TokenChunkerStrategy,
1291
+ z.ZodTypeDef,
1292
+ unknown
1293
+ > = z.object({
1294
+ text: z.string(),
1295
+ metadata: z.boolean().default(true),
1296
+ return_type: ReturnTypeT$inboundSchema.default("chunks"),
1297
+ strategy: TokenChunker$inboundSchema,
1298
+ chunk_size: z.number().int().default(512),
1299
+ chunk_overlap: z.number().int().default(0),
1300
+ }).transform((v) => {
1301
+ return remap$(v, {
1302
+ "return_type": "returnType",
1303
+ "chunk_size": "chunkSize",
1304
+ "chunk_overlap": "chunkOverlap",
1305
+ });
1306
+ });
1307
+
1308
+ /** @internal */
1309
+ export type TokenChunkerStrategy$Outbound = {
1310
+ text: string;
1311
+ metadata: boolean;
1312
+ return_type: string;
1313
+ strategy: string;
1314
+ chunk_size: number;
1315
+ chunk_overlap: number;
1316
+ };
1317
+
1318
+ /** @internal */
1319
+ export const TokenChunkerStrategy$outboundSchema: z.ZodType<
1320
+ TokenChunkerStrategy$Outbound,
1321
+ z.ZodTypeDef,
1322
+ TokenChunkerStrategy
1323
+ > = z.object({
1324
+ text: z.string(),
1325
+ metadata: z.boolean().default(true),
1326
+ returnType: ReturnTypeT$outboundSchema.default("chunks"),
1327
+ strategy: TokenChunker$outboundSchema,
1328
+ chunkSize: z.number().int().default(512),
1329
+ chunkOverlap: z.number().int().default(0),
1330
+ }).transform((v) => {
1331
+ return remap$(v, {
1332
+ returnType: "return_type",
1333
+ chunkSize: "chunk_size",
1334
+ chunkOverlap: "chunk_overlap",
1335
+ });
1336
+ });
1337
+
1338
+ /**
1339
+ * @internal
1340
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1341
+ */
1342
+ export namespace TokenChunkerStrategy$ {
1343
+ /** @deprecated use `TokenChunkerStrategy$inboundSchema` instead. */
1344
+ export const inboundSchema = TokenChunkerStrategy$inboundSchema;
1345
+ /** @deprecated use `TokenChunkerStrategy$outboundSchema` instead. */
1346
+ export const outboundSchema = TokenChunkerStrategy$outboundSchema;
1347
+ /** @deprecated use `TokenChunkerStrategy$Outbound` instead. */
1348
+ export type Outbound = TokenChunkerStrategy$Outbound;
1349
+ }
1350
+
1351
+ export function tokenChunkerStrategyToJSON(
1352
+ tokenChunkerStrategy: TokenChunkerStrategy,
1353
+ ): string {
1354
+ return JSON.stringify(
1355
+ TokenChunkerStrategy$outboundSchema.parse(tokenChunkerStrategy),
1356
+ );
1357
+ }
1358
+
1359
+ export function tokenChunkerStrategyFromJSON(
1360
+ jsonString: string,
1361
+ ): SafeParseResult<TokenChunkerStrategy, SDKValidationError> {
1362
+ return safeParse(
1363
+ jsonString,
1364
+ (x) => TokenChunkerStrategy$inboundSchema.parse(JSON.parse(x)),
1365
+ `Failed to parse 'TokenChunkerStrategy' from JSON`,
1366
+ );
1367
+ }
1368
+
1369
+ /** @internal */
1370
+ export const ParseChunkingRequest$inboundSchema: z.ZodType<
1371
+ ParseChunkingRequest,
1372
+ z.ZodTypeDef,
1373
+ unknown
1374
+ > = z.union([
1375
+ z.lazy(() => SemanticChunkerStrategy$inboundSchema),
1376
+ z.lazy(() => SDPMChunkerStrategy$inboundSchema),
1377
+ z.lazy(() => AgenticChunkerStrategy$inboundSchema),
1378
+ z.lazy(() => TokenChunkerStrategy$inboundSchema),
1379
+ z.lazy(() => SentenceChunkerStrategy$inboundSchema),
1380
+ z.lazy(() => RecursiveChunkerStrategy$inboundSchema),
1381
+ ]);
1382
+
1383
+ /** @internal */
1384
+ export type ParseChunkingRequest$Outbound =
1385
+ | SemanticChunkerStrategy$Outbound
1386
+ | SDPMChunkerStrategy$Outbound
1387
+ | AgenticChunkerStrategy$Outbound
1388
+ | TokenChunkerStrategy$Outbound
1389
+ | SentenceChunkerStrategy$Outbound
1390
+ | RecursiveChunkerStrategy$Outbound;
1391
+
1392
+ /** @internal */
1393
+ export const ParseChunkingRequest$outboundSchema: z.ZodType<
1394
+ ParseChunkingRequest$Outbound,
1395
+ z.ZodTypeDef,
1396
+ ParseChunkingRequest
1397
+ > = z.union([
1398
+ z.lazy(() => SemanticChunkerStrategy$outboundSchema),
1399
+ z.lazy(() => SDPMChunkerStrategy$outboundSchema),
1400
+ z.lazy(() => AgenticChunkerStrategy$outboundSchema),
1401
+ z.lazy(() => TokenChunkerStrategy$outboundSchema),
1402
+ z.lazy(() => SentenceChunkerStrategy$outboundSchema),
1403
+ z.lazy(() => RecursiveChunkerStrategy$outboundSchema),
1404
+ ]);
1405
+
1406
+ /**
1407
+ * @internal
1408
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1409
+ */
1410
+ export namespace ParseChunkingRequest$ {
1411
+ /** @deprecated use `ParseChunkingRequest$inboundSchema` instead. */
1412
+ export const inboundSchema = ParseChunkingRequest$inboundSchema;
1413
+ /** @deprecated use `ParseChunkingRequest$outboundSchema` instead. */
1414
+ export const outboundSchema = ParseChunkingRequest$outboundSchema;
1415
+ /** @deprecated use `ParseChunkingRequest$Outbound` instead. */
1416
+ export type Outbound = ParseChunkingRequest$Outbound;
1417
+ }
1418
+
1419
+ export function parseChunkingRequestToJSON(
1420
+ parseChunkingRequest: ParseChunkingRequest,
1421
+ ): string {
1422
+ return JSON.stringify(
1423
+ ParseChunkingRequest$outboundSchema.parse(parseChunkingRequest),
1424
+ );
1425
+ }
1426
+
1427
+ export function parseChunkingRequestFromJSON(
1428
+ jsonString: string,
1429
+ ): SafeParseResult<ParseChunkingRequest, SDKValidationError> {
1430
+ return safeParse(
1431
+ jsonString,
1432
+ (x) => ParseChunkingRequest$inboundSchema.parse(JSON.parse(x)),
1433
+ `Failed to parse 'ParseChunkingRequest' from JSON`,
1434
+ );
1435
+ }
1436
+
1437
+ /** @internal */
1438
+ export const ParseMetadata$inboundSchema: z.ZodType<
1439
+ ParseMetadata,
1440
+ z.ZodTypeDef,
1441
+ unknown
1442
+ > = z.object({
1443
+ start_index: z.nullable(z.number()),
1444
+ end_index: z.nullable(z.number()),
1445
+ token_count: z.nullable(z.number()),
1446
+ }).transform((v) => {
1447
+ return remap$(v, {
1448
+ "start_index": "startIndex",
1449
+ "end_index": "endIndex",
1450
+ "token_count": "tokenCount",
1451
+ });
1452
+ });
1453
+
1454
+ /** @internal */
1455
+ export type ParseMetadata$Outbound = {
1456
+ start_index: number | null;
1457
+ end_index: number | null;
1458
+ token_count: number | null;
1459
+ };
1460
+
1461
+ /** @internal */
1462
+ export const ParseMetadata$outboundSchema: z.ZodType<
1463
+ ParseMetadata$Outbound,
1464
+ z.ZodTypeDef,
1465
+ ParseMetadata
1466
+ > = z.object({
1467
+ startIndex: z.nullable(z.number()),
1468
+ endIndex: z.nullable(z.number()),
1469
+ tokenCount: z.nullable(z.number()),
1470
+ }).transform((v) => {
1471
+ return remap$(v, {
1472
+ startIndex: "start_index",
1473
+ endIndex: "end_index",
1474
+ tokenCount: "token_count",
1475
+ });
1476
+ });
1477
+
1478
+ /**
1479
+ * @internal
1480
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1481
+ */
1482
+ export namespace ParseMetadata$ {
1483
+ /** @deprecated use `ParseMetadata$inboundSchema` instead. */
1484
+ export const inboundSchema = ParseMetadata$inboundSchema;
1485
+ /** @deprecated use `ParseMetadata$outboundSchema` instead. */
1486
+ export const outboundSchema = ParseMetadata$outboundSchema;
1487
+ /** @deprecated use `ParseMetadata$Outbound` instead. */
1488
+ export type Outbound = ParseMetadata$Outbound;
1489
+ }
1490
+
1491
+ export function parseMetadataToJSON(parseMetadata: ParseMetadata): string {
1492
+ return JSON.stringify(ParseMetadata$outboundSchema.parse(parseMetadata));
1493
+ }
1494
+
1495
+ export function parseMetadataFromJSON(
1496
+ jsonString: string,
1497
+ ): SafeParseResult<ParseMetadata, SDKValidationError> {
1498
+ return safeParse(
1499
+ jsonString,
1500
+ (x) => ParseMetadata$inboundSchema.parse(JSON.parse(x)),
1501
+ `Failed to parse 'ParseMetadata' from JSON`,
1502
+ );
1503
+ }
1504
+
1505
+ /** @internal */
1506
+ export const Chunks$inboundSchema: z.ZodType<Chunks, z.ZodTypeDef, unknown> = z
1507
+ .object({
1508
+ text: z.string(),
1509
+ index: z.number(),
1510
+ metadata: z.lazy(() => ParseMetadata$inboundSchema).optional(),
1511
+ });
1512
+
1513
+ /** @internal */
1514
+ export type Chunks$Outbound = {
1515
+ text: string;
1516
+ index: number;
1517
+ metadata?: ParseMetadata$Outbound | undefined;
1518
+ };
1519
+
1520
+ /** @internal */
1521
+ export const Chunks$outboundSchema: z.ZodType<
1522
+ Chunks$Outbound,
1523
+ z.ZodTypeDef,
1524
+ Chunks
1525
+ > = z.object({
1526
+ text: z.string(),
1527
+ index: z.number(),
1528
+ metadata: z.lazy(() => ParseMetadata$outboundSchema).optional(),
1529
+ });
1530
+
1531
+ /**
1532
+ * @internal
1533
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1534
+ */
1535
+ export namespace Chunks$ {
1536
+ /** @deprecated use `Chunks$inboundSchema` instead. */
1537
+ export const inboundSchema = Chunks$inboundSchema;
1538
+ /** @deprecated use `Chunks$outboundSchema` instead. */
1539
+ export const outboundSchema = Chunks$outboundSchema;
1540
+ /** @deprecated use `Chunks$Outbound` instead. */
1541
+ export type Outbound = Chunks$Outbound;
1542
+ }
1543
+
1544
+ export function chunksToJSON(chunks: Chunks): string {
1545
+ return JSON.stringify(Chunks$outboundSchema.parse(chunks));
1546
+ }
1547
+
1548
+ export function chunksFromJSON(
1549
+ jsonString: string,
1550
+ ): SafeParseResult<Chunks, SDKValidationError> {
1551
+ return safeParse(
1552
+ jsonString,
1553
+ (x) => Chunks$inboundSchema.parse(JSON.parse(x)),
1554
+ `Failed to parse 'Chunks' from JSON`,
1555
+ );
1556
+ }
1557
+
1558
+ /** @internal */
1559
+ export const ParseResponseBody$inboundSchema: z.ZodType<
1560
+ ParseResponseBody,
1561
+ z.ZodTypeDef,
1562
+ unknown
1563
+ > = z.object({
1564
+ chunks: z.array(z.lazy(() => Chunks$inboundSchema)),
1565
+ });
1566
+
1567
+ /** @internal */
1568
+ export type ParseResponseBody$Outbound = {
1569
+ chunks: Array<Chunks$Outbound>;
1570
+ };
1571
+
1572
+ /** @internal */
1573
+ export const ParseResponseBody$outboundSchema: z.ZodType<
1574
+ ParseResponseBody$Outbound,
1575
+ z.ZodTypeDef,
1576
+ ParseResponseBody
1577
+ > = z.object({
1578
+ chunks: z.array(z.lazy(() => Chunks$outboundSchema)),
1579
+ });
1580
+
1581
+ /**
1582
+ * @internal
1583
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1584
+ */
1585
+ export namespace ParseResponseBody$ {
1586
+ /** @deprecated use `ParseResponseBody$inboundSchema` instead. */
1587
+ export const inboundSchema = ParseResponseBody$inboundSchema;
1588
+ /** @deprecated use `ParseResponseBody$outboundSchema` instead. */
1589
+ export const outboundSchema = ParseResponseBody$outboundSchema;
1590
+ /** @deprecated use `ParseResponseBody$Outbound` instead. */
1591
+ export type Outbound = ParseResponseBody$Outbound;
1592
+ }
1593
+
1594
+ export function parseResponseBodyToJSON(
1595
+ parseResponseBody: ParseResponseBody,
1596
+ ): string {
1597
+ return JSON.stringify(
1598
+ ParseResponseBody$outboundSchema.parse(parseResponseBody),
1599
+ );
1600
+ }
1601
+
1602
+ export function parseResponseBodyFromJSON(
1603
+ jsonString: string,
1604
+ ): SafeParseResult<ParseResponseBody, SDKValidationError> {
1605
+ return safeParse(
1606
+ jsonString,
1607
+ (x) => ParseResponseBody$inboundSchema.parse(JSON.parse(x)),
1608
+ `Failed to parse 'ParseResponseBody' from JSON`,
1609
+ );
1610
+ }