@orq-ai/node 3.8.4 → 3.8.6

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