@mixedbread/sdk 0.50.1 → 0.51.0

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 (88) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/bin/migration-config.json +0 -70
  3. package/client.d.mts +5 -7
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +5 -7
  6. package/client.d.ts.map +1 -1
  7. package/client.js +11 -6
  8. package/client.js.map +1 -1
  9. package/client.mjs +11 -6
  10. package/client.mjs.map +1 -1
  11. package/internal/parse.d.mts.map +1 -1
  12. package/internal/parse.d.ts.map +1 -1
  13. package/internal/parse.js +5 -0
  14. package/internal/parse.js.map +1 -1
  15. package/internal/parse.mjs +5 -0
  16. package/internal/parse.mjs.map +1 -1
  17. package/package.json +1 -1
  18. package/resources/index.d.mts +1 -2
  19. package/resources/index.d.mts.map +1 -1
  20. package/resources/index.d.ts +1 -2
  21. package/resources/index.d.ts.map +1 -1
  22. package/resources/index.js +1 -3
  23. package/resources/index.js.map +1 -1
  24. package/resources/index.mjs +0 -1
  25. package/resources/index.mjs.map +1 -1
  26. package/resources/stores/files.d.mts +94 -20
  27. package/resources/stores/files.d.mts.map +1 -1
  28. package/resources/stores/files.d.ts +94 -20
  29. package/resources/stores/files.d.ts.map +1 -1
  30. package/resources/stores/index.d.mts +1 -1
  31. package/resources/stores/index.d.mts.map +1 -1
  32. package/resources/stores/index.d.ts +1 -1
  33. package/resources/stores/index.d.ts.map +1 -1
  34. package/resources/stores/index.js.map +1 -1
  35. package/resources/stores/index.mjs.map +1 -1
  36. package/resources/stores/stores.d.mts +599 -10
  37. package/resources/stores/stores.d.mts.map +1 -1
  38. package/resources/stores/stores.d.ts +599 -10
  39. package/resources/stores/stores.d.ts.map +1 -1
  40. package/resources/stores/stores.js.map +1 -1
  41. package/resources/stores/stores.mjs.map +1 -1
  42. package/src/client.ts +23 -42
  43. package/src/internal/parse.ts +6 -0
  44. package/src/resources/index.ts +5 -19
  45. package/src/resources/stores/files.ts +132 -19
  46. package/src/resources/stores/index.ts +5 -0
  47. package/src/resources/stores/stores.ts +898 -15
  48. package/src/version.ts +1 -1
  49. package/version.d.mts +1 -1
  50. package/version.d.ts +1 -1
  51. package/version.js +1 -1
  52. package/version.mjs +1 -1
  53. package/resources/vector-stores/files.d.mts +0 -1379
  54. package/resources/vector-stores/files.d.mts.map +0 -1
  55. package/resources/vector-stores/files.d.ts +0 -1379
  56. package/resources/vector-stores/files.d.ts.map +0 -1
  57. package/resources/vector-stores/files.js +0 -126
  58. package/resources/vector-stores/files.js.map +0 -1
  59. package/resources/vector-stores/files.mjs +0 -121
  60. package/resources/vector-stores/files.mjs.map +0 -1
  61. package/resources/vector-stores/index.d.mts +0 -3
  62. package/resources/vector-stores/index.d.mts.map +0 -1
  63. package/resources/vector-stores/index.d.ts +0 -3
  64. package/resources/vector-stores/index.d.ts.map +0 -1
  65. package/resources/vector-stores/index.js +0 -9
  66. package/resources/vector-stores/index.js.map +0 -1
  67. package/resources/vector-stores/index.mjs +0 -4
  68. package/resources/vector-stores/index.mjs.map +0 -1
  69. package/resources/vector-stores/vector-stores.d.mts +0 -1885
  70. package/resources/vector-stores/vector-stores.d.mts.map +0 -1
  71. package/resources/vector-stores/vector-stores.d.ts +0 -1885
  72. package/resources/vector-stores/vector-stores.d.ts.map +0 -1
  73. package/resources/vector-stores/vector-stores.js +0 -75
  74. package/resources/vector-stores/vector-stores.js.map +0 -1
  75. package/resources/vector-stores/vector-stores.mjs +0 -70
  76. package/resources/vector-stores/vector-stores.mjs.map +0 -1
  77. package/resources/vector-stores.d.mts +0 -2
  78. package/resources/vector-stores.d.mts.map +0 -1
  79. package/resources/vector-stores.d.ts +0 -2
  80. package/resources/vector-stores.d.ts.map +0 -1
  81. package/resources/vector-stores.js +0 -6
  82. package/resources/vector-stores.js.map +0 -1
  83. package/resources/vector-stores.mjs +0 -3
  84. package/resources/vector-stores.mjs.map +0 -1
  85. package/src/resources/vector-stores/files.ts +0 -2062
  86. package/src/resources/vector-stores/index.ts +0 -36
  87. package/src/resources/vector-stores/vector-stores.ts +0 -2809
  88. package/src/resources/vector-stores.ts +0 -3
@@ -1,2062 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import { APIResource } from '../../core/resource';
4
- import * as VectorStoresFilesAPI from './files';
5
- import * as Shared from '../shared';
6
- import * as FilesAPI from '../stores/files';
7
- import { APIPromise } from '../../core/api-promise';
8
- import { RequestOptions } from '../../internal/request-options';
9
- import * as polling from '../../lib/polling';
10
- import { Uploadable } from '../../uploads';
11
- import { path } from '../../internal/utils/path';
12
-
13
- export class Files extends APIResource {
14
- /**
15
- * DEPRECATED: Use POST /stores/{store_identifier}/files instead
16
- *
17
- * @deprecated Use post stores.files instead
18
- */
19
- create(
20
- vectorStoreIdentifier: string,
21
- body: FileCreateParams,
22
- options?: RequestOptions,
23
- ): APIPromise<VectorStoreFile> {
24
- return this._client.post(path`/v1/vector_stores/${vectorStoreIdentifier}/files`, { body, ...options });
25
- }
26
-
27
- /**
28
- * DEPRECATED: Use GET /stores/{store_identifier}/files/{file_id} instead
29
- *
30
- * @deprecated Use stores.files instead
31
- */
32
- retrieve(
33
- fileID: string,
34
- params: FileRetrieveParams,
35
- options?: RequestOptions,
36
- ): APIPromise<VectorStoreFile> {
37
- const { vector_store_identifier, ...query } = params;
38
- return this._client.get(path`/v1/vector_stores/${vector_store_identifier}/files/${fileID}`, {
39
- query,
40
- ...options,
41
- });
42
- }
43
-
44
- /**
45
- * DEPRECATED: Use POST /stores/{store_identifier}/files/list instead
46
- *
47
- * @deprecated Use post stores.files.list instead
48
- */
49
- list(
50
- vectorStoreIdentifier: string,
51
- body: FileListParams,
52
- options?: RequestOptions,
53
- ): APIPromise<FileListResponse> {
54
- return this._client.post(path`/v1/vector_stores/${vectorStoreIdentifier}/files/list`, {
55
- body,
56
- ...options,
57
- });
58
- }
59
-
60
- /**
61
- * DEPRECATED: Use DELETE /stores/{store_identifier}/files/{file_id} instead
62
- *
63
- * @deprecated Use stores.files instead
64
- */
65
- delete(fileID: string, params: FileDeleteParams, options?: RequestOptions): APIPromise<FileDeleteResponse> {
66
- const { vector_store_identifier } = params;
67
- return this._client.delete(path`/v1/vector_stores/${vector_store_identifier}/files/${fileID}`, options);
68
- }
69
-
70
- /**
71
- * DEPRECATED: Use POST /stores/{store_identifier}/files/search instead
72
- *
73
- * @deprecated Use stores.files.search instead
74
- */
75
- search(body: FileSearchParams, options?: RequestOptions): APIPromise<FileSearchResponse> {
76
- return this._client.post('/v1/vector_stores/files/search', { body, ...options });
77
- }
78
-
79
- /**
80
- * Poll for a file's processing status until it reaches a terminal state.
81
- *
82
- * @param vectorStoreIdentifier - The identifier of the vector store
83
- * @param fileId - The ID of the file to poll
84
- * @param pollIntervalMs - The interval between polls in milliseconds (default: 500)
85
- * @param pollTimeoutMs - The maximum time to poll for in milliseconds (default: no timeout)
86
- * @param options - Additional request options
87
- * @returns The file object once it reaches a terminal state
88
- */
89
- async poll(
90
- vectorStoreIdentifier: string,
91
- fileId: string,
92
- pollIntervalMs?: number,
93
- pollTimeoutMs?: number,
94
- options?: RequestOptions,
95
- ): Promise<VectorStoreFile> {
96
- const pollingIntervalMs = pollIntervalMs || 500;
97
- const pollingTimeoutMs = pollTimeoutMs;
98
-
99
- return polling.poll({
100
- fn: () => this.retrieve(fileId, { vector_store_identifier: vectorStoreIdentifier, ...options }),
101
- condition: (result) =>
102
- result.status === 'completed' || result.status === 'failed' || result.status === 'cancelled',
103
- intervalSeconds: pollingIntervalMs / 1000,
104
- ...(pollingTimeoutMs && { timeoutSeconds: pollingTimeoutMs / 1000 }),
105
- });
106
- }
107
-
108
- /**
109
- * Create a file in a vector store and wait for it to be processed.
110
- *
111
- * @param vectorStoreIdentifier - The identifier of the vector store to upload to
112
- * @param body - The file creation parameters
113
- * @param pollIntervalMs - The interval between polls in milliseconds (default: 500)
114
- * @param pollTimeoutMs - The maximum time to poll for in milliseconds (default: no timeout)
115
- * @param options - Additional request options
116
- * @returns The file object once it reaches a terminal state
117
- */
118
- async createAndPoll(
119
- vectorStoreIdentifier: string,
120
- body: FileCreateParams,
121
- pollIntervalMs?: number,
122
- pollTimeoutMs?: number,
123
- options?: RequestOptions,
124
- ): Promise<VectorStoreFile> {
125
- const file = await this.create(vectorStoreIdentifier, body, options);
126
- return this.poll(vectorStoreIdentifier, file.id, pollIntervalMs, pollTimeoutMs, options);
127
- }
128
-
129
- /**
130
- * Upload a file to the files API and then create a file in a vector store.
131
- * Note the file will be asynchronously processed.
132
- *
133
- * @param vectorStoreIdentifier - The identifier of the vector store to add the file to
134
- * @param file - The file to upload
135
- * @param body - Additional parameters for the vector store file
136
- * @param options - Additional request options
137
- * @returns The created vector store file
138
- */
139
- async upload(
140
- vectorStoreIdentifier: string,
141
- file: Uploadable,
142
- body?: Omit<FileCreateParams, 'file_id'>,
143
- options?: RequestOptions,
144
- ): Promise<VectorStoreFile> {
145
- const fileUploadResponse = await this._client.files.create({ file }, options);
146
-
147
- return this.create(
148
- vectorStoreIdentifier,
149
- {
150
- file_id: fileUploadResponse.id,
151
- ...body,
152
- },
153
- options,
154
- );
155
- }
156
-
157
- /**
158
- * Upload a file to files API, create a file in a vector store, and poll until processing is complete.
159
- *
160
- * @param vectorStoreIdentifier - The identifier of the vector store to add the file to
161
- * @param file - The file to upload
162
- * @param body - Additional parameters for the vector store file
163
- * @param pollIntervalMs - The interval between polls in milliseconds (default: 500)
164
- * @param pollTimeoutMs - The maximum time to poll for in milliseconds (default: no timeout)
165
- * @param options - Additional request options
166
- * @returns The vector store file object once it reaches a terminal state
167
- */
168
- async uploadAndPoll(
169
- vectorStoreIdentifier: string,
170
- file: Uploadable,
171
- body?: Omit<FileCreateParams, 'file_id'>,
172
- pollIntervalMs?: number,
173
- pollTimeoutMs?: number,
174
- options?: RequestOptions,
175
- ): Promise<VectorStoreFile> {
176
- const vectorStoreFile = await this.upload(vectorStoreIdentifier, file, body, options);
177
- return this.poll(vectorStoreIdentifier, vectorStoreFile.id, pollIntervalMs, pollTimeoutMs, options);
178
- }
179
- }
180
-
181
- /**
182
- * Represents a reranking configuration.
183
- */
184
- export interface RerankConfig {
185
- /**
186
- * The name of the reranking model
187
- */
188
- model?: string;
189
-
190
- /**
191
- * Whether to include metadata in the reranked results
192
- */
193
- with_metadata?: boolean | Array<string>;
194
-
195
- /**
196
- * Maximum number of results to return after reranking. If None, returns all
197
- * reranked results.
198
- */
199
- top_k?: number | null;
200
- }
201
-
202
- /**
203
- * Represents a scored store file.
204
- */
205
- export interface ScoredVectorStoreFile {
206
- /**
207
- * Unique identifier for the file
208
- */
209
- id: string;
210
-
211
- /**
212
- * Name of the file
213
- */
214
- filename?: string;
215
-
216
- /**
217
- * Optional file metadata
218
- */
219
- metadata?: unknown;
220
-
221
- /**
222
- * Processing status of the file
223
- */
224
- status?: FilesAPI.StoreFileStatus;
225
-
226
- /**
227
- * Last error message if processing failed
228
- */
229
- last_error?: unknown;
230
-
231
- /**
232
- * ID of the containing store
233
- */
234
- vector_store_id: string;
235
-
236
- /**
237
- * Timestamp of store file creation
238
- */
239
- created_at: string;
240
-
241
- /**
242
- * Version number of the file
243
- */
244
- version?: number | null;
245
-
246
- /**
247
- * Storage usage in bytes
248
- */
249
- usage_bytes?: number | null;
250
-
251
- /**
252
- * Type of the object
253
- */
254
- object?: 'vector_store.file';
255
-
256
- /**
257
- * Array of scored file chunks
258
- */
259
- chunks: Array<
260
- | ScoredVectorStoreFile.MxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk
261
- | ScoredVectorStoreFile.MxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk
262
- | ScoredVectorStoreFile.MxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk
263
- | ScoredVectorStoreFile.MxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk
264
- > | null;
265
-
266
- /**
267
- * score of the file
268
- */
269
- score: number;
270
- }
271
-
272
- export namespace ScoredVectorStoreFile {
273
- /**
274
- * Scored text chunk for deprecated API.
275
- */
276
- export interface MxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk {
277
- /**
278
- * position of the chunk in a file
279
- */
280
- chunk_index: number;
281
-
282
- /**
283
- * mime type of the chunk
284
- */
285
- mime_type?: string;
286
-
287
- /**
288
- * metadata of the chunk
289
- */
290
- generated_metadata?:
291
- | MxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk.MarkdownChunkGeneratedMetadata
292
- | MxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk.TextChunkGeneratedMetadata
293
- | MxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk.PdfChunkGeneratedMetadata
294
- | MxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk.CodeChunkGeneratedMetadata
295
- | MxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk.AudioChunkGeneratedMetadata
296
- | null;
297
-
298
- /**
299
- * model used for this chunk
300
- */
301
- model?: string | null;
302
-
303
- /**
304
- * score of the chunk
305
- */
306
- score: number;
307
-
308
- /**
309
- * file id
310
- */
311
- file_id: string;
312
-
313
- /**
314
- * filename
315
- */
316
- filename: string;
317
-
318
- /**
319
- * store id
320
- */
321
- vector_store_id: string;
322
-
323
- /**
324
- * file metadata
325
- */
326
- metadata?: unknown;
327
-
328
- /**
329
- * Input type identifier
330
- */
331
- type?: 'text';
332
-
333
- /**
334
- * The offset of the text in the file relative to the start of the file.
335
- */
336
- offset?: number;
337
-
338
- /**
339
- * Text content to process
340
- */
341
- text: string;
342
- }
343
-
344
- export namespace MxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk {
345
- export interface MarkdownChunkGeneratedMetadata {
346
- type?: 'markdown';
347
-
348
- file_type?: 'text/markdown';
349
-
350
- language: string;
351
-
352
- word_count: number;
353
-
354
- file_size: number;
355
-
356
- chunk_headings?: Array<MarkdownChunkGeneratedMetadata.ChunkHeading>;
357
-
358
- heading_context?: Array<MarkdownChunkGeneratedMetadata.HeadingContext>;
359
-
360
- start_line?: number;
361
-
362
- num_lines?: number;
363
-
364
- [k: string]: unknown;
365
- }
366
-
367
- export namespace MarkdownChunkGeneratedMetadata {
368
- export interface ChunkHeading {
369
- level: number;
370
-
371
- text: string;
372
- }
373
-
374
- export interface HeadingContext {
375
- level: number;
376
-
377
- text: string;
378
- }
379
- }
380
-
381
- export interface TextChunkGeneratedMetadata {
382
- type?: 'text';
383
-
384
- file_type?: 'text/plain';
385
-
386
- language: string;
387
-
388
- word_count: number;
389
-
390
- file_size: number;
391
-
392
- start_line?: number;
393
-
394
- num_lines?: number;
395
-
396
- [k: string]: unknown;
397
- }
398
-
399
- export interface PdfChunkGeneratedMetadata {
400
- type?: 'pdf';
401
-
402
- file_type?: 'application/pdf';
403
-
404
- total_pages: number;
405
-
406
- total_size: number;
407
-
408
- [k: string]: unknown;
409
- }
410
-
411
- export interface CodeChunkGeneratedMetadata {
412
- type?: 'code';
413
-
414
- file_type: string;
415
-
416
- language: string;
417
-
418
- word_count: number;
419
-
420
- file_size: number;
421
-
422
- start_line?: number;
423
-
424
- num_lines?: number;
425
-
426
- [k: string]: unknown;
427
- }
428
-
429
- export interface AudioChunkGeneratedMetadata {
430
- type?: 'audio';
431
-
432
- file_type: string;
433
-
434
- file_size: number;
435
-
436
- total_duration_seconds: number;
437
-
438
- sample_rate: number;
439
-
440
- channels: number;
441
-
442
- audio_format: number;
443
-
444
- [k: string]: unknown;
445
- }
446
- }
447
-
448
- /**
449
- * Scored image chunk for deprecated API.
450
- */
451
- export interface MxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk {
452
- /**
453
- * position of the chunk in a file
454
- */
455
- chunk_index: number;
456
-
457
- /**
458
- * mime type of the chunk
459
- */
460
- mime_type?: string;
461
-
462
- /**
463
- * metadata of the chunk
464
- */
465
- generated_metadata?:
466
- | MxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk.MarkdownChunkGeneratedMetadata
467
- | MxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk.TextChunkGeneratedMetadata
468
- | MxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk.PdfChunkGeneratedMetadata
469
- | MxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk.CodeChunkGeneratedMetadata
470
- | MxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk.AudioChunkGeneratedMetadata
471
- | null;
472
-
473
- /**
474
- * model used for this chunk
475
- */
476
- model?: string | null;
477
-
478
- /**
479
- * score of the chunk
480
- */
481
- score: number;
482
-
483
- /**
484
- * file id
485
- */
486
- file_id: string;
487
-
488
- /**
489
- * filename
490
- */
491
- filename: string;
492
-
493
- /**
494
- * store id
495
- */
496
- vector_store_id: string;
497
-
498
- /**
499
- * file metadata
500
- */
501
- metadata?: unknown;
502
-
503
- /**
504
- * Input type identifier
505
- */
506
- type?: 'image_url';
507
-
508
- /**
509
- * ocr text of the image
510
- */
511
- ocr_text?: string | null;
512
-
513
- /**
514
- * summary of the image
515
- */
516
- summary?: string | null;
517
-
518
- /**
519
- * The image input specification.
520
- */
521
- image_url: MxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk.ImageURL;
522
- }
523
-
524
- export namespace MxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk {
525
- export interface MarkdownChunkGeneratedMetadata {
526
- type?: 'markdown';
527
-
528
- file_type?: 'text/markdown';
529
-
530
- language: string;
531
-
532
- word_count: number;
533
-
534
- file_size: number;
535
-
536
- chunk_headings?: Array<MarkdownChunkGeneratedMetadata.ChunkHeading>;
537
-
538
- heading_context?: Array<MarkdownChunkGeneratedMetadata.HeadingContext>;
539
-
540
- start_line?: number;
541
-
542
- num_lines?: number;
543
-
544
- [k: string]: unknown;
545
- }
546
-
547
- export namespace MarkdownChunkGeneratedMetadata {
548
- export interface ChunkHeading {
549
- level: number;
550
-
551
- text: string;
552
- }
553
-
554
- export interface HeadingContext {
555
- level: number;
556
-
557
- text: string;
558
- }
559
- }
560
-
561
- export interface TextChunkGeneratedMetadata {
562
- type?: 'text';
563
-
564
- file_type?: 'text/plain';
565
-
566
- language: string;
567
-
568
- word_count: number;
569
-
570
- file_size: number;
571
-
572
- start_line?: number;
573
-
574
- num_lines?: number;
575
-
576
- [k: string]: unknown;
577
- }
578
-
579
- export interface PdfChunkGeneratedMetadata {
580
- type?: 'pdf';
581
-
582
- file_type?: 'application/pdf';
583
-
584
- total_pages: number;
585
-
586
- total_size: number;
587
-
588
- [k: string]: unknown;
589
- }
590
-
591
- export interface CodeChunkGeneratedMetadata {
592
- type?: 'code';
593
-
594
- file_type: string;
595
-
596
- language: string;
597
-
598
- word_count: number;
599
-
600
- file_size: number;
601
-
602
- start_line?: number;
603
-
604
- num_lines?: number;
605
-
606
- [k: string]: unknown;
607
- }
608
-
609
- export interface AudioChunkGeneratedMetadata {
610
- type?: 'audio';
611
-
612
- file_type: string;
613
-
614
- file_size: number;
615
-
616
- total_duration_seconds: number;
617
-
618
- sample_rate: number;
619
-
620
- channels: number;
621
-
622
- audio_format: number;
623
-
624
- [k: string]: unknown;
625
- }
626
-
627
- /**
628
- * The image input specification.
629
- */
630
- export interface ImageURL {
631
- /**
632
- * The image URL. Can be either a URL or a Data URI.
633
- */
634
- url: string;
635
-
636
- /**
637
- * The image format/mimetype
638
- */
639
- format?: string;
640
- }
641
- }
642
-
643
- /**
644
- * Scored audio chunk for deprecated API.
645
- */
646
- export interface MxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk {
647
- /**
648
- * position of the chunk in a file
649
- */
650
- chunk_index: number;
651
-
652
- /**
653
- * mime type of the chunk
654
- */
655
- mime_type?: string;
656
-
657
- /**
658
- * metadata of the chunk
659
- */
660
- generated_metadata?:
661
- | MxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk.MarkdownChunkGeneratedMetadata
662
- | MxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk.TextChunkGeneratedMetadata
663
- | MxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk.PdfChunkGeneratedMetadata
664
- | MxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk.CodeChunkGeneratedMetadata
665
- | MxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk.AudioChunkGeneratedMetadata
666
- | null;
667
-
668
- /**
669
- * model used for this chunk
670
- */
671
- model?: string | null;
672
-
673
- /**
674
- * score of the chunk
675
- */
676
- score: number;
677
-
678
- /**
679
- * file id
680
- */
681
- file_id: string;
682
-
683
- /**
684
- * filename
685
- */
686
- filename: string;
687
-
688
- /**
689
- * store id
690
- */
691
- vector_store_id: string;
692
-
693
- /**
694
- * file metadata
695
- */
696
- metadata?: unknown;
697
-
698
- /**
699
- * Input type identifier
700
- */
701
- type?: 'audio_url';
702
-
703
- /**
704
- * speech recognition (sr) text of the audio
705
- */
706
- transcription?: string | null;
707
-
708
- /**
709
- * summary of the audio
710
- */
711
- summary?: string | null;
712
-
713
- /**
714
- * The audio input specification.
715
- */
716
- audio_url: MxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk.AudioURL;
717
-
718
- /**
719
- * The sampling rate of the audio.
720
- */
721
- sampling_rate: number;
722
- }
723
-
724
- export namespace MxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk {
725
- export interface MarkdownChunkGeneratedMetadata {
726
- type?: 'markdown';
727
-
728
- file_type?: 'text/markdown';
729
-
730
- language: string;
731
-
732
- word_count: number;
733
-
734
- file_size: number;
735
-
736
- chunk_headings?: Array<MarkdownChunkGeneratedMetadata.ChunkHeading>;
737
-
738
- heading_context?: Array<MarkdownChunkGeneratedMetadata.HeadingContext>;
739
-
740
- start_line?: number;
741
-
742
- num_lines?: number;
743
-
744
- [k: string]: unknown;
745
- }
746
-
747
- export namespace MarkdownChunkGeneratedMetadata {
748
- export interface ChunkHeading {
749
- level: number;
750
-
751
- text: string;
752
- }
753
-
754
- export interface HeadingContext {
755
- level: number;
756
-
757
- text: string;
758
- }
759
- }
760
-
761
- export interface TextChunkGeneratedMetadata {
762
- type?: 'text';
763
-
764
- file_type?: 'text/plain';
765
-
766
- language: string;
767
-
768
- word_count: number;
769
-
770
- file_size: number;
771
-
772
- start_line?: number;
773
-
774
- num_lines?: number;
775
-
776
- [k: string]: unknown;
777
- }
778
-
779
- export interface PdfChunkGeneratedMetadata {
780
- type?: 'pdf';
781
-
782
- file_type?: 'application/pdf';
783
-
784
- total_pages: number;
785
-
786
- total_size: number;
787
-
788
- [k: string]: unknown;
789
- }
790
-
791
- export interface CodeChunkGeneratedMetadata {
792
- type?: 'code';
793
-
794
- file_type: string;
795
-
796
- language: string;
797
-
798
- word_count: number;
799
-
800
- file_size: number;
801
-
802
- start_line?: number;
803
-
804
- num_lines?: number;
805
-
806
- [k: string]: unknown;
807
- }
808
-
809
- export interface AudioChunkGeneratedMetadata {
810
- type?: 'audio';
811
-
812
- file_type: string;
813
-
814
- file_size: number;
815
-
816
- total_duration_seconds: number;
817
-
818
- sample_rate: number;
819
-
820
- channels: number;
821
-
822
- audio_format: number;
823
-
824
- [k: string]: unknown;
825
- }
826
-
827
- /**
828
- * The audio input specification.
829
- */
830
- export interface AudioURL {
831
- /**
832
- * The audio URL. Can be either a URL or a Data URI.
833
- */
834
- url: string;
835
- }
836
- }
837
-
838
- /**
839
- * Scored video chunk for deprecated API.
840
- */
841
- export interface MxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk {
842
- /**
843
- * position of the chunk in a file
844
- */
845
- chunk_index: number;
846
-
847
- /**
848
- * mime type of the chunk
849
- */
850
- mime_type?: string;
851
-
852
- /**
853
- * metadata of the chunk
854
- */
855
- generated_metadata?:
856
- | MxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk.MarkdownChunkGeneratedMetadata
857
- | MxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk.TextChunkGeneratedMetadata
858
- | MxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk.PdfChunkGeneratedMetadata
859
- | MxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk.CodeChunkGeneratedMetadata
860
- | MxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk.AudioChunkGeneratedMetadata
861
- | null;
862
-
863
- /**
864
- * model used for this chunk
865
- */
866
- model?: string | null;
867
-
868
- /**
869
- * score of the chunk
870
- */
871
- score: number;
872
-
873
- /**
874
- * file id
875
- */
876
- file_id: string;
877
-
878
- /**
879
- * filename
880
- */
881
- filename: string;
882
-
883
- /**
884
- * store id
885
- */
886
- vector_store_id: string;
887
-
888
- /**
889
- * file metadata
890
- */
891
- metadata?: unknown;
892
-
893
- /**
894
- * Input type identifier
895
- */
896
- type?: 'video_url';
897
-
898
- /**
899
- * speech recognition (sr) text of the video
900
- */
901
- transcription?: string | null;
902
-
903
- /**
904
- * summary of the video
905
- */
906
- summary?: string | null;
907
-
908
- /**
909
- * The video input specification.
910
- */
911
- video_url: MxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk.VideoURL;
912
- }
913
-
914
- export namespace MxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk {
915
- export interface MarkdownChunkGeneratedMetadata {
916
- type?: 'markdown';
917
-
918
- file_type?: 'text/markdown';
919
-
920
- language: string;
921
-
922
- word_count: number;
923
-
924
- file_size: number;
925
-
926
- chunk_headings?: Array<MarkdownChunkGeneratedMetadata.ChunkHeading>;
927
-
928
- heading_context?: Array<MarkdownChunkGeneratedMetadata.HeadingContext>;
929
-
930
- start_line?: number;
931
-
932
- num_lines?: number;
933
-
934
- [k: string]: unknown;
935
- }
936
-
937
- export namespace MarkdownChunkGeneratedMetadata {
938
- export interface ChunkHeading {
939
- level: number;
940
-
941
- text: string;
942
- }
943
-
944
- export interface HeadingContext {
945
- level: number;
946
-
947
- text: string;
948
- }
949
- }
950
-
951
- export interface TextChunkGeneratedMetadata {
952
- type?: 'text';
953
-
954
- file_type?: 'text/plain';
955
-
956
- language: string;
957
-
958
- word_count: number;
959
-
960
- file_size: number;
961
-
962
- start_line?: number;
963
-
964
- num_lines?: number;
965
-
966
- [k: string]: unknown;
967
- }
968
-
969
- export interface PdfChunkGeneratedMetadata {
970
- type?: 'pdf';
971
-
972
- file_type?: 'application/pdf';
973
-
974
- total_pages: number;
975
-
976
- total_size: number;
977
-
978
- [k: string]: unknown;
979
- }
980
-
981
- export interface CodeChunkGeneratedMetadata {
982
- type?: 'code';
983
-
984
- file_type: string;
985
-
986
- language: string;
987
-
988
- word_count: number;
989
-
990
- file_size: number;
991
-
992
- start_line?: number;
993
-
994
- num_lines?: number;
995
-
996
- [k: string]: unknown;
997
- }
998
-
999
- export interface AudioChunkGeneratedMetadata {
1000
- type?: 'audio';
1001
-
1002
- file_type: string;
1003
-
1004
- file_size: number;
1005
-
1006
- total_duration_seconds: number;
1007
-
1008
- sample_rate: number;
1009
-
1010
- channels: number;
1011
-
1012
- audio_format: number;
1013
-
1014
- [k: string]: unknown;
1015
- }
1016
-
1017
- /**
1018
- * The video input specification.
1019
- */
1020
- export interface VideoURL {
1021
- /**
1022
- * The video URL. Can be either a URL or a Data URI.
1023
- */
1024
- url: string;
1025
- }
1026
- }
1027
- }
1028
-
1029
- export type VectorStoreFileStatus = 'pending' | 'in_progress' | 'cancelled' | 'completed' | 'failed';
1030
-
1031
- /**
1032
- * Represents a file stored in a store.
1033
- */
1034
- export interface VectorStoreFile {
1035
- /**
1036
- * Unique identifier for the file
1037
- */
1038
- id: string;
1039
-
1040
- /**
1041
- * Name of the file
1042
- */
1043
- filename?: string;
1044
-
1045
- /**
1046
- * Optional file metadata
1047
- */
1048
- metadata?: unknown;
1049
-
1050
- /**
1051
- * Processing status of the file
1052
- */
1053
- status?: FilesAPI.StoreFileStatus;
1054
-
1055
- /**
1056
- * Last error message if processing failed
1057
- */
1058
- last_error?: unknown;
1059
-
1060
- /**
1061
- * ID of the containing store
1062
- */
1063
- vector_store_id: string;
1064
-
1065
- /**
1066
- * Timestamp of store file creation
1067
- */
1068
- created_at: string;
1069
-
1070
- /**
1071
- * Version number of the file
1072
- */
1073
- version?: number | null;
1074
-
1075
- /**
1076
- * Storage usage in bytes
1077
- */
1078
- usage_bytes?: number | null;
1079
-
1080
- /**
1081
- * Type of the object
1082
- */
1083
- object?: 'vector_store.file';
1084
-
1085
- /**
1086
- * chunks
1087
- */
1088
- chunks?: Array<
1089
- | VectorStoreFile.TextInputChunk
1090
- | VectorStoreFile.ImageURLInputChunk
1091
- | VectorStoreFile.AudioURLInputChunk
1092
- | VectorStoreFile.VideoURLInputChunk
1093
- > | null;
1094
- }
1095
-
1096
- export namespace VectorStoreFile {
1097
- export interface TextInputChunk {
1098
- /**
1099
- * position of the chunk in a file
1100
- */
1101
- chunk_index: number;
1102
-
1103
- /**
1104
- * mime type of the chunk
1105
- */
1106
- mime_type?: string;
1107
-
1108
- /**
1109
- * metadata of the chunk
1110
- */
1111
- generated_metadata?:
1112
- | TextInputChunk.MarkdownChunkGeneratedMetadata
1113
- | TextInputChunk.TextChunkGeneratedMetadata
1114
- | TextInputChunk.PdfChunkGeneratedMetadata
1115
- | TextInputChunk.CodeChunkGeneratedMetadata
1116
- | TextInputChunk.AudioChunkGeneratedMetadata
1117
- | null;
1118
-
1119
- /**
1120
- * model used for this chunk
1121
- */
1122
- model?: string | null;
1123
-
1124
- /**
1125
- * Input type identifier
1126
- */
1127
- type?: 'text';
1128
-
1129
- /**
1130
- * The offset of the text in the file relative to the start of the file.
1131
- */
1132
- offset?: number;
1133
-
1134
- /**
1135
- * Text content to process
1136
- */
1137
- text: string;
1138
- }
1139
-
1140
- export namespace TextInputChunk {
1141
- export interface MarkdownChunkGeneratedMetadata {
1142
- type?: 'markdown';
1143
-
1144
- file_type?: 'text/markdown';
1145
-
1146
- language: string;
1147
-
1148
- word_count: number;
1149
-
1150
- file_size: number;
1151
-
1152
- chunk_headings?: Array<MarkdownChunkGeneratedMetadata.ChunkHeading>;
1153
-
1154
- heading_context?: Array<MarkdownChunkGeneratedMetadata.HeadingContext>;
1155
-
1156
- start_line?: number;
1157
-
1158
- num_lines?: number;
1159
-
1160
- [k: string]: unknown;
1161
- }
1162
-
1163
- export namespace MarkdownChunkGeneratedMetadata {
1164
- export interface ChunkHeading {
1165
- level: number;
1166
-
1167
- text: string;
1168
- }
1169
-
1170
- export interface HeadingContext {
1171
- level: number;
1172
-
1173
- text: string;
1174
- }
1175
- }
1176
-
1177
- export interface TextChunkGeneratedMetadata {
1178
- type?: 'text';
1179
-
1180
- file_type?: 'text/plain';
1181
-
1182
- language: string;
1183
-
1184
- word_count: number;
1185
-
1186
- file_size: number;
1187
-
1188
- start_line?: number;
1189
-
1190
- num_lines?: number;
1191
-
1192
- [k: string]: unknown;
1193
- }
1194
-
1195
- export interface PdfChunkGeneratedMetadata {
1196
- type?: 'pdf';
1197
-
1198
- file_type?: 'application/pdf';
1199
-
1200
- total_pages: number;
1201
-
1202
- total_size: number;
1203
-
1204
- [k: string]: unknown;
1205
- }
1206
-
1207
- export interface CodeChunkGeneratedMetadata {
1208
- type?: 'code';
1209
-
1210
- file_type: string;
1211
-
1212
- language: string;
1213
-
1214
- word_count: number;
1215
-
1216
- file_size: number;
1217
-
1218
- start_line?: number;
1219
-
1220
- num_lines?: number;
1221
-
1222
- [k: string]: unknown;
1223
- }
1224
-
1225
- export interface AudioChunkGeneratedMetadata {
1226
- type?: 'audio';
1227
-
1228
- file_type: string;
1229
-
1230
- file_size: number;
1231
-
1232
- total_duration_seconds: number;
1233
-
1234
- sample_rate: number;
1235
-
1236
- channels: number;
1237
-
1238
- audio_format: number;
1239
-
1240
- [k: string]: unknown;
1241
- }
1242
- }
1243
-
1244
- export interface ImageURLInputChunk {
1245
- /**
1246
- * position of the chunk in a file
1247
- */
1248
- chunk_index: number;
1249
-
1250
- /**
1251
- * mime type of the chunk
1252
- */
1253
- mime_type?: string;
1254
-
1255
- /**
1256
- * metadata of the chunk
1257
- */
1258
- generated_metadata?:
1259
- | ImageURLInputChunk.MarkdownChunkGeneratedMetadata
1260
- | ImageURLInputChunk.TextChunkGeneratedMetadata
1261
- | ImageURLInputChunk.PdfChunkGeneratedMetadata
1262
- | ImageURLInputChunk.CodeChunkGeneratedMetadata
1263
- | ImageURLInputChunk.AudioChunkGeneratedMetadata
1264
- | null;
1265
-
1266
- /**
1267
- * model used for this chunk
1268
- */
1269
- model?: string | null;
1270
-
1271
- /**
1272
- * Input type identifier
1273
- */
1274
- type?: 'image_url';
1275
-
1276
- /**
1277
- * ocr text of the image
1278
- */
1279
- ocr_text?: string | null;
1280
-
1281
- /**
1282
- * summary of the image
1283
- */
1284
- summary?: string | null;
1285
-
1286
- /**
1287
- * The image input specification.
1288
- */
1289
- image_url: ImageURLInputChunk.ImageURL;
1290
- }
1291
-
1292
- export namespace ImageURLInputChunk {
1293
- export interface MarkdownChunkGeneratedMetadata {
1294
- type?: 'markdown';
1295
-
1296
- file_type?: 'text/markdown';
1297
-
1298
- language: string;
1299
-
1300
- word_count: number;
1301
-
1302
- file_size: number;
1303
-
1304
- chunk_headings?: Array<MarkdownChunkGeneratedMetadata.ChunkHeading>;
1305
-
1306
- heading_context?: Array<MarkdownChunkGeneratedMetadata.HeadingContext>;
1307
-
1308
- start_line?: number;
1309
-
1310
- num_lines?: number;
1311
-
1312
- [k: string]: unknown;
1313
- }
1314
-
1315
- export namespace MarkdownChunkGeneratedMetadata {
1316
- export interface ChunkHeading {
1317
- level: number;
1318
-
1319
- text: string;
1320
- }
1321
-
1322
- export interface HeadingContext {
1323
- level: number;
1324
-
1325
- text: string;
1326
- }
1327
- }
1328
-
1329
- export interface TextChunkGeneratedMetadata {
1330
- type?: 'text';
1331
-
1332
- file_type?: 'text/plain';
1333
-
1334
- language: string;
1335
-
1336
- word_count: number;
1337
-
1338
- file_size: number;
1339
-
1340
- start_line?: number;
1341
-
1342
- num_lines?: number;
1343
-
1344
- [k: string]: unknown;
1345
- }
1346
-
1347
- export interface PdfChunkGeneratedMetadata {
1348
- type?: 'pdf';
1349
-
1350
- file_type?: 'application/pdf';
1351
-
1352
- total_pages: number;
1353
-
1354
- total_size: number;
1355
-
1356
- [k: string]: unknown;
1357
- }
1358
-
1359
- export interface CodeChunkGeneratedMetadata {
1360
- type?: 'code';
1361
-
1362
- file_type: string;
1363
-
1364
- language: string;
1365
-
1366
- word_count: number;
1367
-
1368
- file_size: number;
1369
-
1370
- start_line?: number;
1371
-
1372
- num_lines?: number;
1373
-
1374
- [k: string]: unknown;
1375
- }
1376
-
1377
- export interface AudioChunkGeneratedMetadata {
1378
- type?: 'audio';
1379
-
1380
- file_type: string;
1381
-
1382
- file_size: number;
1383
-
1384
- total_duration_seconds: number;
1385
-
1386
- sample_rate: number;
1387
-
1388
- channels: number;
1389
-
1390
- audio_format: number;
1391
-
1392
- [k: string]: unknown;
1393
- }
1394
-
1395
- /**
1396
- * The image input specification.
1397
- */
1398
- export interface ImageURL {
1399
- /**
1400
- * The image URL. Can be either a URL or a Data URI.
1401
- */
1402
- url: string;
1403
-
1404
- /**
1405
- * The image format/mimetype
1406
- */
1407
- format?: string;
1408
- }
1409
- }
1410
-
1411
- export interface AudioURLInputChunk {
1412
- /**
1413
- * position of the chunk in a file
1414
- */
1415
- chunk_index: number;
1416
-
1417
- /**
1418
- * mime type of the chunk
1419
- */
1420
- mime_type?: string;
1421
-
1422
- /**
1423
- * metadata of the chunk
1424
- */
1425
- generated_metadata?:
1426
- | AudioURLInputChunk.MarkdownChunkGeneratedMetadata
1427
- | AudioURLInputChunk.TextChunkGeneratedMetadata
1428
- | AudioURLInputChunk.PdfChunkGeneratedMetadata
1429
- | AudioURLInputChunk.CodeChunkGeneratedMetadata
1430
- | AudioURLInputChunk.AudioChunkGeneratedMetadata
1431
- | null;
1432
-
1433
- /**
1434
- * model used for this chunk
1435
- */
1436
- model?: string | null;
1437
-
1438
- /**
1439
- * Input type identifier
1440
- */
1441
- type?: 'audio_url';
1442
-
1443
- /**
1444
- * speech recognition (sr) text of the audio
1445
- */
1446
- transcription?: string | null;
1447
-
1448
- /**
1449
- * summary of the audio
1450
- */
1451
- summary?: string | null;
1452
-
1453
- /**
1454
- * The audio input specification.
1455
- */
1456
- audio_url: AudioURLInputChunk.AudioURL;
1457
-
1458
- /**
1459
- * The sampling rate of the audio.
1460
- */
1461
- sampling_rate: number;
1462
- }
1463
-
1464
- export namespace AudioURLInputChunk {
1465
- export interface MarkdownChunkGeneratedMetadata {
1466
- type?: 'markdown';
1467
-
1468
- file_type?: 'text/markdown';
1469
-
1470
- language: string;
1471
-
1472
- word_count: number;
1473
-
1474
- file_size: number;
1475
-
1476
- chunk_headings?: Array<MarkdownChunkGeneratedMetadata.ChunkHeading>;
1477
-
1478
- heading_context?: Array<MarkdownChunkGeneratedMetadata.HeadingContext>;
1479
-
1480
- start_line?: number;
1481
-
1482
- num_lines?: number;
1483
-
1484
- [k: string]: unknown;
1485
- }
1486
-
1487
- export namespace MarkdownChunkGeneratedMetadata {
1488
- export interface ChunkHeading {
1489
- level: number;
1490
-
1491
- text: string;
1492
- }
1493
-
1494
- export interface HeadingContext {
1495
- level: number;
1496
-
1497
- text: string;
1498
- }
1499
- }
1500
-
1501
- export interface TextChunkGeneratedMetadata {
1502
- type?: 'text';
1503
-
1504
- file_type?: 'text/plain';
1505
-
1506
- language: string;
1507
-
1508
- word_count: number;
1509
-
1510
- file_size: number;
1511
-
1512
- start_line?: number;
1513
-
1514
- num_lines?: number;
1515
-
1516
- [k: string]: unknown;
1517
- }
1518
-
1519
- export interface PdfChunkGeneratedMetadata {
1520
- type?: 'pdf';
1521
-
1522
- file_type?: 'application/pdf';
1523
-
1524
- total_pages: number;
1525
-
1526
- total_size: number;
1527
-
1528
- [k: string]: unknown;
1529
- }
1530
-
1531
- export interface CodeChunkGeneratedMetadata {
1532
- type?: 'code';
1533
-
1534
- file_type: string;
1535
-
1536
- language: string;
1537
-
1538
- word_count: number;
1539
-
1540
- file_size: number;
1541
-
1542
- start_line?: number;
1543
-
1544
- num_lines?: number;
1545
-
1546
- [k: string]: unknown;
1547
- }
1548
-
1549
- export interface AudioChunkGeneratedMetadata {
1550
- type?: 'audio';
1551
-
1552
- file_type: string;
1553
-
1554
- file_size: number;
1555
-
1556
- total_duration_seconds: number;
1557
-
1558
- sample_rate: number;
1559
-
1560
- channels: number;
1561
-
1562
- audio_format: number;
1563
-
1564
- [k: string]: unknown;
1565
- }
1566
-
1567
- /**
1568
- * The audio input specification.
1569
- */
1570
- export interface AudioURL {
1571
- /**
1572
- * The audio URL. Can be either a URL or a Data URI.
1573
- */
1574
- url: string;
1575
- }
1576
- }
1577
-
1578
- export interface VideoURLInputChunk {
1579
- /**
1580
- * position of the chunk in a file
1581
- */
1582
- chunk_index: number;
1583
-
1584
- /**
1585
- * mime type of the chunk
1586
- */
1587
- mime_type?: string;
1588
-
1589
- /**
1590
- * metadata of the chunk
1591
- */
1592
- generated_metadata?:
1593
- | VideoURLInputChunk.MarkdownChunkGeneratedMetadata
1594
- | VideoURLInputChunk.TextChunkGeneratedMetadata
1595
- | VideoURLInputChunk.PdfChunkGeneratedMetadata
1596
- | VideoURLInputChunk.CodeChunkGeneratedMetadata
1597
- | VideoURLInputChunk.AudioChunkGeneratedMetadata
1598
- | null;
1599
-
1600
- /**
1601
- * model used for this chunk
1602
- */
1603
- model?: string | null;
1604
-
1605
- /**
1606
- * Input type identifier
1607
- */
1608
- type?: 'video_url';
1609
-
1610
- /**
1611
- * speech recognition (sr) text of the video
1612
- */
1613
- transcription?: string | null;
1614
-
1615
- /**
1616
- * summary of the video
1617
- */
1618
- summary?: string | null;
1619
-
1620
- /**
1621
- * The video input specification.
1622
- */
1623
- video_url: VideoURLInputChunk.VideoURL;
1624
- }
1625
-
1626
- export namespace VideoURLInputChunk {
1627
- export interface MarkdownChunkGeneratedMetadata {
1628
- type?: 'markdown';
1629
-
1630
- file_type?: 'text/markdown';
1631
-
1632
- language: string;
1633
-
1634
- word_count: number;
1635
-
1636
- file_size: number;
1637
-
1638
- chunk_headings?: Array<MarkdownChunkGeneratedMetadata.ChunkHeading>;
1639
-
1640
- heading_context?: Array<MarkdownChunkGeneratedMetadata.HeadingContext>;
1641
-
1642
- start_line?: number;
1643
-
1644
- num_lines?: number;
1645
-
1646
- [k: string]: unknown;
1647
- }
1648
-
1649
- export namespace MarkdownChunkGeneratedMetadata {
1650
- export interface ChunkHeading {
1651
- level: number;
1652
-
1653
- text: string;
1654
- }
1655
-
1656
- export interface HeadingContext {
1657
- level: number;
1658
-
1659
- text: string;
1660
- }
1661
- }
1662
-
1663
- export interface TextChunkGeneratedMetadata {
1664
- type?: 'text';
1665
-
1666
- file_type?: 'text/plain';
1667
-
1668
- language: string;
1669
-
1670
- word_count: number;
1671
-
1672
- file_size: number;
1673
-
1674
- start_line?: number;
1675
-
1676
- num_lines?: number;
1677
-
1678
- [k: string]: unknown;
1679
- }
1680
-
1681
- export interface PdfChunkGeneratedMetadata {
1682
- type?: 'pdf';
1683
-
1684
- file_type?: 'application/pdf';
1685
-
1686
- total_pages: number;
1687
-
1688
- total_size: number;
1689
-
1690
- [k: string]: unknown;
1691
- }
1692
-
1693
- export interface CodeChunkGeneratedMetadata {
1694
- type?: 'code';
1695
-
1696
- file_type: string;
1697
-
1698
- language: string;
1699
-
1700
- word_count: number;
1701
-
1702
- file_size: number;
1703
-
1704
- start_line?: number;
1705
-
1706
- num_lines?: number;
1707
-
1708
- [k: string]: unknown;
1709
- }
1710
-
1711
- export interface AudioChunkGeneratedMetadata {
1712
- type?: 'audio';
1713
-
1714
- file_type: string;
1715
-
1716
- file_size: number;
1717
-
1718
- total_duration_seconds: number;
1719
-
1720
- sample_rate: number;
1721
-
1722
- channels: number;
1723
-
1724
- audio_format: number;
1725
-
1726
- [k: string]: unknown;
1727
- }
1728
-
1729
- /**
1730
- * The video input specification.
1731
- */
1732
- export interface VideoURL {
1733
- /**
1734
- * The video URL. Can be either a URL or a Data URI.
1735
- */
1736
- url: string;
1737
- }
1738
- }
1739
- }
1740
-
1741
- /**
1742
- * List response wrapper for vector store files.
1743
- */
1744
- export interface FileListResponse {
1745
- /**
1746
- * Response model for cursor-based pagination.
1747
- */
1748
- pagination: FileListResponse.Pagination;
1749
-
1750
- /**
1751
- * The object type of the response
1752
- */
1753
- object?: 'list';
1754
-
1755
- /**
1756
- * The list of vector store files
1757
- */
1758
- data: Array<VectorStoreFile>;
1759
- }
1760
-
1761
- export namespace FileListResponse {
1762
- /**
1763
- * Response model for cursor-based pagination.
1764
- */
1765
- export interface Pagination {
1766
- /**
1767
- * Contextual direction-aware flag: True if more items exist in the requested
1768
- * pagination direction. For 'after': more items after this page. For 'before':
1769
- * more items before this page.
1770
- */
1771
- has_more: boolean;
1772
-
1773
- /**
1774
- * Cursor of the first item in this page. Use for backward pagination. None if page
1775
- * is empty.
1776
- */
1777
- first_cursor: string | null;
1778
-
1779
- /**
1780
- * Cursor of the last item in this page. Use for forward pagination. None if page
1781
- * is empty.
1782
- */
1783
- last_cursor: string | null;
1784
-
1785
- /**
1786
- * Total number of items available across all pages. Only included when
1787
- * include_total=true was requested. Expensive operation - use sparingly.
1788
- */
1789
- total?: number | null;
1790
- }
1791
- }
1792
-
1793
- /**
1794
- * Response model for file deletion.
1795
- */
1796
- export interface FileDeleteResponse {
1797
- /**
1798
- * ID of the deleted file
1799
- */
1800
- id: string;
1801
-
1802
- /**
1803
- * Whether the deletion was successful
1804
- */
1805
- deleted?: boolean;
1806
-
1807
- /**
1808
- * Type of the deleted object
1809
- */
1810
- object?: 'vector_store.file';
1811
- }
1812
-
1813
- /**
1814
- * Search response wrapper for vector store files.
1815
- */
1816
- export interface FileSearchResponse {
1817
- /**
1818
- * The object type of the response
1819
- */
1820
- object?: 'list';
1821
-
1822
- /**
1823
- * The list of scored vector store files
1824
- */
1825
- data: Array<ScoredVectorStoreFile>;
1826
- }
1827
-
1828
- export interface FileCreateParams {
1829
- /**
1830
- * Optional metadata for the file
1831
- */
1832
- metadata?: unknown;
1833
-
1834
- /**
1835
- * Configuration for adding the file
1836
- */
1837
- config?: FileCreateParams.Config;
1838
-
1839
- /**
1840
- * External identifier for this file in the store
1841
- */
1842
- external_id?: string | null;
1843
-
1844
- /**
1845
- * If true, overwrite an existing file with the same external_id
1846
- */
1847
- overwrite?: boolean;
1848
-
1849
- /**
1850
- * ID of the file to add
1851
- */
1852
- file_id: string;
1853
-
1854
- /**
1855
- * @deprecated Configuration for a file.
1856
- */
1857
- experimental?: FileCreateParams.Experimental | null;
1858
- }
1859
-
1860
- export namespace FileCreateParams {
1861
- /**
1862
- * Configuration for adding the file
1863
- */
1864
- export interface Config {
1865
- /**
1866
- * Strategy for adding the file, this overrides the store-level default
1867
- */
1868
- parsing_strategy?: 'fast' | 'high_quality';
1869
- }
1870
-
1871
- /**
1872
- * @deprecated Configuration for a file.
1873
- */
1874
- export interface Experimental {
1875
- /**
1876
- * Strategy for adding the file, this overrides the store-level default
1877
- */
1878
- parsing_strategy?: 'fast' | 'high_quality';
1879
- }
1880
- }
1881
-
1882
- export interface FileRetrieveParams {
1883
- /**
1884
- * Path param: The ID or name of the vector store
1885
- */
1886
- vector_store_identifier: string;
1887
-
1888
- /**
1889
- * Query param: Whether to return the chunks for the file
1890
- */
1891
- return_chunks?: boolean;
1892
- }
1893
-
1894
- export interface FileListParams {
1895
- /**
1896
- * Maximum number of items to return per page (1-100)
1897
- */
1898
- limit?: number;
1899
-
1900
- /**
1901
- * Cursor for forward pagination - get items after this position. Use last_cursor
1902
- * from previous response.
1903
- */
1904
- after?: string | null;
1905
-
1906
- /**
1907
- * Cursor for backward pagination - get items before this position. Use
1908
- * first_cursor from previous response.
1909
- */
1910
- before?: string | null;
1911
-
1912
- /**
1913
- * Whether to include total count in response (expensive operation)
1914
- */
1915
- include_total?: boolean;
1916
-
1917
- /**
1918
- * Status to filter by
1919
- */
1920
- statuses?: Array<FilesAPI.StoreFileStatus> | null;
1921
-
1922
- /**
1923
- * Metadata filter to apply to the query
1924
- */
1925
- metadata_filter?:
1926
- | Shared.SearchFilter
1927
- | Shared.SearchFilterCondition
1928
- | Array<Shared.SearchFilter | Shared.SearchFilterCondition>
1929
- | null;
1930
- }
1931
-
1932
- export interface FileDeleteParams {
1933
- /**
1934
- * The ID or name of the vector store
1935
- */
1936
- vector_store_identifier: string;
1937
- }
1938
-
1939
- export interface FileSearchParams {
1940
- /**
1941
- * Search query text
1942
- */
1943
- query: string;
1944
-
1945
- /**
1946
- * IDs or names of vector stores to search
1947
- */
1948
- vector_store_identifiers: Array<string>;
1949
-
1950
- /**
1951
- * Number of results to return
1952
- */
1953
- top_k?: number;
1954
-
1955
- /**
1956
- * Optional filter conditions
1957
- */
1958
- filters?:
1959
- | Shared.SearchFilter
1960
- | Shared.SearchFilterCondition
1961
- | Array<Shared.SearchFilter | Shared.SearchFilterCondition>
1962
- | null;
1963
-
1964
- /**
1965
- * Optional list of file IDs to filter chunks by (inclusion filter)
1966
- */
1967
- file_ids?: Array<unknown> | Array<string> | null;
1968
-
1969
- /**
1970
- * Search configuration options
1971
- */
1972
- search_options?: FileSearchParams.SearchOptions;
1973
- }
1974
-
1975
- export namespace FileSearchParams {
1976
- /**
1977
- * Search configuration options
1978
- */
1979
- export interface SearchOptions {
1980
- /**
1981
- * Minimum similarity score threshold
1982
- */
1983
- score_threshold?: number;
1984
-
1985
- /**
1986
- * Whether to rewrite the query. Ignored when agentic is enabled (the agent handles
1987
- * query decomposition).
1988
- */
1989
- rewrite_query?: boolean;
1990
-
1991
- /**
1992
- * Whether to rerank results and optional reranking configuration. Ignored when
1993
- * agentic is enabled (the agent handles ranking).
1994
- */
1995
- rerank?: boolean | VectorStoresFilesAPI.RerankConfig | null;
1996
-
1997
- /**
1998
- * Whether to use agentic multi-query search with automatic query decomposition and
1999
- * ranking. When enabled, rewrite_query and rerank options are ignored.
2000
- */
2001
- agentic?: boolean | SearchOptions.AgenticSearchConfig | null;
2002
-
2003
- /**
2004
- * Whether to return file metadata
2005
- */
2006
- return_metadata?: boolean;
2007
-
2008
- /**
2009
- * Whether to return matching text chunks
2010
- */
2011
- return_chunks?: boolean;
2012
-
2013
- /**
2014
- * Number of chunks to return for each file
2015
- */
2016
- chunks_per_file?: number;
2017
-
2018
- /**
2019
- * Whether to apply search rules
2020
- */
2021
- apply_search_rules?: boolean;
2022
- }
2023
-
2024
- export namespace SearchOptions {
2025
- /**
2026
- * Configuration for agentic multi-query search.
2027
- */
2028
- export interface AgenticSearchConfig {
2029
- /**
2030
- * Maximum number of search rounds
2031
- */
2032
- max_rounds?: number;
2033
-
2034
- /**
2035
- * Maximum queries per round
2036
- */
2037
- queries_per_round?: number;
2038
-
2039
- /**
2040
- * Results to fetch per query
2041
- */
2042
- results_per_query?: number;
2043
- }
2044
- }
2045
- }
2046
-
2047
- export declare namespace Files {
2048
- export {
2049
- type RerankConfig as RerankConfig,
2050
- type ScoredVectorStoreFile as ScoredVectorStoreFile,
2051
- type VectorStoreFileStatus as VectorStoreFileStatus,
2052
- type VectorStoreFile as VectorStoreFile,
2053
- type FileListResponse as FileListResponse,
2054
- type FileDeleteResponse as FileDeleteResponse,
2055
- type FileSearchResponse as FileSearchResponse,
2056
- type FileCreateParams as FileCreateParams,
2057
- type FileRetrieveParams as FileRetrieveParams,
2058
- type FileListParams as FileListParams,
2059
- type FileDeleteParams as FileDeleteParams,
2060
- type FileSearchParams as FileSearchParams,
2061
- };
2062
- }