@mixedbread/sdk 0.50.2 → 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 +31 -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
@@ -2,6 +2,7 @@
2
2
 
3
3
  import { APIResource } from '../../core/resource';
4
4
  import * as Shared from '../shared';
5
+ import * as ContentAPI from '../extractions/content';
5
6
  import * as FilesAPI from './files';
6
7
  import {
7
8
  FileCreateParams,
@@ -18,8 +19,6 @@ import {
18
19
  StoreFile,
19
20
  StoreFileStatus,
20
21
  } from './files';
21
- import * as VectorStoresFilesAPI from '../vector-stores/files';
22
- import * as VectorStoresAPI from '../vector-stores/vector-stores';
23
22
  import { APIPromise } from '../../core/api-promise';
24
23
  import { Cursor, type CursorParams, PagePromise } from '../../core/pagination';
25
24
  import { RequestOptions } from '../../internal/request-options';
@@ -139,6 +138,856 @@ export class Stores extends APIResource {
139
138
 
140
139
  export type StoresCursor = Cursor<Store>;
141
140
 
141
+ /**
142
+ * Represents an expiration policy for a store.
143
+ */
144
+ export interface ExpiresAfter {
145
+ /**
146
+ * Anchor date for the expiration policy
147
+ */
148
+ anchor?: 'last_active_at';
149
+
150
+ /**
151
+ * Number of days after which the store expires
152
+ */
153
+ days?: number;
154
+ }
155
+
156
+ export interface ScoredAudioURLInputChunk {
157
+ /**
158
+ * position of the chunk in a file
159
+ */
160
+ chunk_index: number;
161
+
162
+ /**
163
+ * mime type of the chunk
164
+ */
165
+ mime_type?: string;
166
+
167
+ /**
168
+ * metadata of the chunk
169
+ */
170
+ generated_metadata?:
171
+ | ScoredAudioURLInputChunk.MarkdownChunkGeneratedMetadata
172
+ | ScoredAudioURLInputChunk.TextChunkGeneratedMetadata
173
+ | ScoredAudioURLInputChunk.PdfChunkGeneratedMetadata
174
+ | ScoredAudioURLInputChunk.CodeChunkGeneratedMetadata
175
+ | ScoredAudioURLInputChunk.AudioChunkGeneratedMetadata
176
+ | ScoredAudioURLInputChunk.VideoChunkGeneratedMetadata
177
+ | null;
178
+
179
+ /**
180
+ * model used for this chunk
181
+ */
182
+ model?: string | null;
183
+
184
+ /**
185
+ * score of the chunk
186
+ */
187
+ score: number;
188
+
189
+ /**
190
+ * file id
191
+ */
192
+ file_id: string;
193
+
194
+ /**
195
+ * filename
196
+ */
197
+ filename: string;
198
+
199
+ /**
200
+ * store id
201
+ */
202
+ store_id: string;
203
+
204
+ /**
205
+ * file metadata
206
+ */
207
+ metadata?: unknown;
208
+
209
+ /**
210
+ * Input type identifier
211
+ */
212
+ type?: 'audio_url';
213
+
214
+ /**
215
+ * speech recognition (sr) text of the audio
216
+ */
217
+ transcription?: string | null;
218
+
219
+ /**
220
+ * summary of the audio
221
+ */
222
+ summary?: string | null;
223
+
224
+ /**
225
+ * Model for audio URL validation.
226
+ */
227
+ audio_url?: ScoredAudioURLInputChunk.AudioURL | null;
228
+
229
+ /**
230
+ * The sampling rate of the audio.
231
+ */
232
+ sampling_rate: number;
233
+ }
234
+
235
+ export namespace ScoredAudioURLInputChunk {
236
+ export interface MarkdownChunkGeneratedMetadata {
237
+ type?: 'markdown';
238
+
239
+ file_type?: 'text/markdown';
240
+
241
+ language: string;
242
+
243
+ word_count: number;
244
+
245
+ file_size: number;
246
+
247
+ chunk_headings?: Array<MarkdownChunkGeneratedMetadata.ChunkHeading>;
248
+
249
+ heading_context?: Array<MarkdownChunkGeneratedMetadata.HeadingContext>;
250
+
251
+ start_line?: number;
252
+
253
+ num_lines?: number;
254
+
255
+ frontmatter?: { [key: string]: unknown };
256
+
257
+ [k: string]: unknown;
258
+ }
259
+
260
+ export namespace MarkdownChunkGeneratedMetadata {
261
+ export interface ChunkHeading {
262
+ level: number;
263
+
264
+ text: string;
265
+ }
266
+
267
+ export interface HeadingContext {
268
+ level: number;
269
+
270
+ text: string;
271
+ }
272
+ }
273
+
274
+ export interface TextChunkGeneratedMetadata {
275
+ type?: 'text';
276
+
277
+ file_type?: 'text/plain';
278
+
279
+ language: string;
280
+
281
+ word_count: number;
282
+
283
+ file_size: number;
284
+
285
+ start_line?: number;
286
+
287
+ num_lines?: number;
288
+
289
+ [k: string]: unknown;
290
+ }
291
+
292
+ export interface PdfChunkGeneratedMetadata {
293
+ type?: 'pdf';
294
+
295
+ file_type?: 'application/pdf';
296
+
297
+ total_pages: number;
298
+
299
+ total_size: number;
300
+
301
+ [k: string]: unknown;
302
+ }
303
+
304
+ export interface CodeChunkGeneratedMetadata {
305
+ type?: 'code';
306
+
307
+ file_type: string;
308
+
309
+ language: string;
310
+
311
+ word_count: number;
312
+
313
+ file_size: number;
314
+
315
+ start_line?: number;
316
+
317
+ num_lines?: number;
318
+
319
+ [k: string]: unknown;
320
+ }
321
+
322
+ export interface AudioChunkGeneratedMetadata {
323
+ type?: 'audio';
324
+
325
+ file_type: string;
326
+
327
+ file_size: number;
328
+
329
+ total_duration_seconds: number;
330
+
331
+ sample_rate: number;
332
+
333
+ channels: number;
334
+
335
+ audio_format: number;
336
+
337
+ [k: string]: unknown;
338
+ }
339
+
340
+ export interface VideoChunkGeneratedMetadata {
341
+ type?: 'video';
342
+
343
+ file_type: string;
344
+
345
+ file_size: number;
346
+
347
+ total_duration_seconds: number;
348
+
349
+ fps: number;
350
+
351
+ width: number;
352
+
353
+ height: number;
354
+
355
+ frame_count: number;
356
+
357
+ [k: string]: unknown;
358
+ }
359
+
360
+ /**
361
+ * Model for audio URL validation.
362
+ */
363
+ export interface AudioURL {
364
+ /**
365
+ * The audio URL. Can be either a URL or a Data URI.
366
+ */
367
+ url: string;
368
+ }
369
+ }
370
+
371
+ export interface ScoredImageURLInputChunk {
372
+ /**
373
+ * position of the chunk in a file
374
+ */
375
+ chunk_index: number;
376
+
377
+ /**
378
+ * mime type of the chunk
379
+ */
380
+ mime_type?: string;
381
+
382
+ /**
383
+ * metadata of the chunk
384
+ */
385
+ generated_metadata?:
386
+ | ScoredImageURLInputChunk.MarkdownChunkGeneratedMetadata
387
+ | ScoredImageURLInputChunk.TextChunkGeneratedMetadata
388
+ | ScoredImageURLInputChunk.PdfChunkGeneratedMetadata
389
+ | ScoredImageURLInputChunk.CodeChunkGeneratedMetadata
390
+ | ScoredImageURLInputChunk.AudioChunkGeneratedMetadata
391
+ | ScoredImageURLInputChunk.VideoChunkGeneratedMetadata
392
+ | null;
393
+
394
+ /**
395
+ * model used for this chunk
396
+ */
397
+ model?: string | null;
398
+
399
+ /**
400
+ * score of the chunk
401
+ */
402
+ score: number;
403
+
404
+ /**
405
+ * file id
406
+ */
407
+ file_id: string;
408
+
409
+ /**
410
+ * filename
411
+ */
412
+ filename: string;
413
+
414
+ /**
415
+ * store id
416
+ */
417
+ store_id: string;
418
+
419
+ /**
420
+ * file metadata
421
+ */
422
+ metadata?: unknown;
423
+
424
+ /**
425
+ * Input type identifier
426
+ */
427
+ type?: 'image_url';
428
+
429
+ /**
430
+ * ocr text of the image
431
+ */
432
+ ocr_text?: string | null;
433
+
434
+ /**
435
+ * summary of the image
436
+ */
437
+ summary?: string | null;
438
+
439
+ /**
440
+ * Model for image URL validation.
441
+ */
442
+ image_url?: ScoredImageURLInputChunk.ImageURL | null;
443
+ }
444
+
445
+ export namespace ScoredImageURLInputChunk {
446
+ export interface MarkdownChunkGeneratedMetadata {
447
+ type?: 'markdown';
448
+
449
+ file_type?: 'text/markdown';
450
+
451
+ language: string;
452
+
453
+ word_count: number;
454
+
455
+ file_size: number;
456
+
457
+ chunk_headings?: Array<MarkdownChunkGeneratedMetadata.ChunkHeading>;
458
+
459
+ heading_context?: Array<MarkdownChunkGeneratedMetadata.HeadingContext>;
460
+
461
+ start_line?: number;
462
+
463
+ num_lines?: number;
464
+
465
+ frontmatter?: { [key: string]: unknown };
466
+
467
+ [k: string]: unknown;
468
+ }
469
+
470
+ export namespace MarkdownChunkGeneratedMetadata {
471
+ export interface ChunkHeading {
472
+ level: number;
473
+
474
+ text: string;
475
+ }
476
+
477
+ export interface HeadingContext {
478
+ level: number;
479
+
480
+ text: string;
481
+ }
482
+ }
483
+
484
+ export interface TextChunkGeneratedMetadata {
485
+ type?: 'text';
486
+
487
+ file_type?: 'text/plain';
488
+
489
+ language: string;
490
+
491
+ word_count: number;
492
+
493
+ file_size: number;
494
+
495
+ start_line?: number;
496
+
497
+ num_lines?: number;
498
+
499
+ [k: string]: unknown;
500
+ }
501
+
502
+ export interface PdfChunkGeneratedMetadata {
503
+ type?: 'pdf';
504
+
505
+ file_type?: 'application/pdf';
506
+
507
+ total_pages: number;
508
+
509
+ total_size: number;
510
+
511
+ [k: string]: unknown;
512
+ }
513
+
514
+ export interface CodeChunkGeneratedMetadata {
515
+ type?: 'code';
516
+
517
+ file_type: string;
518
+
519
+ language: string;
520
+
521
+ word_count: number;
522
+
523
+ file_size: number;
524
+
525
+ start_line?: number;
526
+
527
+ num_lines?: number;
528
+
529
+ [k: string]: unknown;
530
+ }
531
+
532
+ export interface AudioChunkGeneratedMetadata {
533
+ type?: 'audio';
534
+
535
+ file_type: string;
536
+
537
+ file_size: number;
538
+
539
+ total_duration_seconds: number;
540
+
541
+ sample_rate: number;
542
+
543
+ channels: number;
544
+
545
+ audio_format: number;
546
+
547
+ [k: string]: unknown;
548
+ }
549
+
550
+ export interface VideoChunkGeneratedMetadata {
551
+ type?: 'video';
552
+
553
+ file_type: string;
554
+
555
+ file_size: number;
556
+
557
+ total_duration_seconds: number;
558
+
559
+ fps: number;
560
+
561
+ width: number;
562
+
563
+ height: number;
564
+
565
+ frame_count: number;
566
+
567
+ [k: string]: unknown;
568
+ }
569
+
570
+ /**
571
+ * Model for image URL validation.
572
+ */
573
+ export interface ImageURL {
574
+ /**
575
+ * The image URL. Can be either a URL or a Data URI.
576
+ */
577
+ url: string;
578
+
579
+ /**
580
+ * The image format/mimetype
581
+ */
582
+ format?: string;
583
+ }
584
+ }
585
+
586
+ export interface ScoredTextInputChunk {
587
+ /**
588
+ * position of the chunk in a file
589
+ */
590
+ chunk_index: number;
591
+
592
+ /**
593
+ * mime type of the chunk
594
+ */
595
+ mime_type?: string;
596
+
597
+ /**
598
+ * metadata of the chunk
599
+ */
600
+ generated_metadata?:
601
+ | ScoredTextInputChunk.MarkdownChunkGeneratedMetadata
602
+ | ScoredTextInputChunk.TextChunkGeneratedMetadata
603
+ | ScoredTextInputChunk.PdfChunkGeneratedMetadata
604
+ | ScoredTextInputChunk.CodeChunkGeneratedMetadata
605
+ | ScoredTextInputChunk.AudioChunkGeneratedMetadata
606
+ | ScoredTextInputChunk.VideoChunkGeneratedMetadata
607
+ | null;
608
+
609
+ /**
610
+ * model used for this chunk
611
+ */
612
+ model?: string | null;
613
+
614
+ /**
615
+ * score of the chunk
616
+ */
617
+ score: number;
618
+
619
+ /**
620
+ * file id
621
+ */
622
+ file_id: string;
623
+
624
+ /**
625
+ * filename
626
+ */
627
+ filename: string;
628
+
629
+ /**
630
+ * store id
631
+ */
632
+ store_id: string;
633
+
634
+ /**
635
+ * file metadata
636
+ */
637
+ metadata?: unknown;
638
+
639
+ /**
640
+ * Input type identifier
641
+ */
642
+ type?: 'text';
643
+
644
+ /**
645
+ * The offset of the text in the file relative to the start of the file.
646
+ */
647
+ offset?: number;
648
+
649
+ /**
650
+ * Text content
651
+ */
652
+ text?: string | null;
653
+ }
654
+
655
+ export namespace ScoredTextInputChunk {
656
+ export interface MarkdownChunkGeneratedMetadata {
657
+ type?: 'markdown';
658
+
659
+ file_type?: 'text/markdown';
660
+
661
+ language: string;
662
+
663
+ word_count: number;
664
+
665
+ file_size: number;
666
+
667
+ chunk_headings?: Array<MarkdownChunkGeneratedMetadata.ChunkHeading>;
668
+
669
+ heading_context?: Array<MarkdownChunkGeneratedMetadata.HeadingContext>;
670
+
671
+ start_line?: number;
672
+
673
+ num_lines?: number;
674
+
675
+ frontmatter?: { [key: string]: unknown };
676
+
677
+ [k: string]: unknown;
678
+ }
679
+
680
+ export namespace MarkdownChunkGeneratedMetadata {
681
+ export interface ChunkHeading {
682
+ level: number;
683
+
684
+ text: string;
685
+ }
686
+
687
+ export interface HeadingContext {
688
+ level: number;
689
+
690
+ text: string;
691
+ }
692
+ }
693
+
694
+ export interface TextChunkGeneratedMetadata {
695
+ type?: 'text';
696
+
697
+ file_type?: 'text/plain';
698
+
699
+ language: string;
700
+
701
+ word_count: number;
702
+
703
+ file_size: number;
704
+
705
+ start_line?: number;
706
+
707
+ num_lines?: number;
708
+
709
+ [k: string]: unknown;
710
+ }
711
+
712
+ export interface PdfChunkGeneratedMetadata {
713
+ type?: 'pdf';
714
+
715
+ file_type?: 'application/pdf';
716
+
717
+ total_pages: number;
718
+
719
+ total_size: number;
720
+
721
+ [k: string]: unknown;
722
+ }
723
+
724
+ export interface CodeChunkGeneratedMetadata {
725
+ type?: 'code';
726
+
727
+ file_type: string;
728
+
729
+ language: string;
730
+
731
+ word_count: number;
732
+
733
+ file_size: number;
734
+
735
+ start_line?: number;
736
+
737
+ num_lines?: number;
738
+
739
+ [k: string]: unknown;
740
+ }
741
+
742
+ export interface AudioChunkGeneratedMetadata {
743
+ type?: 'audio';
744
+
745
+ file_type: string;
746
+
747
+ file_size: number;
748
+
749
+ total_duration_seconds: number;
750
+
751
+ sample_rate: number;
752
+
753
+ channels: number;
754
+
755
+ audio_format: number;
756
+
757
+ [k: string]: unknown;
758
+ }
759
+
760
+ export interface VideoChunkGeneratedMetadata {
761
+ type?: 'video';
762
+
763
+ file_type: string;
764
+
765
+ file_size: number;
766
+
767
+ total_duration_seconds: number;
768
+
769
+ fps: number;
770
+
771
+ width: number;
772
+
773
+ height: number;
774
+
775
+ frame_count: number;
776
+
777
+ [k: string]: unknown;
778
+ }
779
+ }
780
+
781
+ export interface ScoredVideoURLInputChunk {
782
+ /**
783
+ * position of the chunk in a file
784
+ */
785
+ chunk_index: number;
786
+
787
+ /**
788
+ * mime type of the chunk
789
+ */
790
+ mime_type?: string;
791
+
792
+ /**
793
+ * metadata of the chunk
794
+ */
795
+ generated_metadata?:
796
+ | ScoredVideoURLInputChunk.MarkdownChunkGeneratedMetadata
797
+ | ScoredVideoURLInputChunk.TextChunkGeneratedMetadata
798
+ | ScoredVideoURLInputChunk.PdfChunkGeneratedMetadata
799
+ | ScoredVideoURLInputChunk.CodeChunkGeneratedMetadata
800
+ | ScoredVideoURLInputChunk.AudioChunkGeneratedMetadata
801
+ | ScoredVideoURLInputChunk.VideoChunkGeneratedMetadata
802
+ | null;
803
+
804
+ /**
805
+ * model used for this chunk
806
+ */
807
+ model?: string | null;
808
+
809
+ /**
810
+ * score of the chunk
811
+ */
812
+ score: number;
813
+
814
+ /**
815
+ * file id
816
+ */
817
+ file_id: string;
818
+
819
+ /**
820
+ * filename
821
+ */
822
+ filename: string;
823
+
824
+ /**
825
+ * store id
826
+ */
827
+ store_id: string;
828
+
829
+ /**
830
+ * file metadata
831
+ */
832
+ metadata?: unknown;
833
+
834
+ /**
835
+ * Input type identifier
836
+ */
837
+ type?: 'video_url';
838
+
839
+ /**
840
+ * speech recognition (sr) text of the video
841
+ */
842
+ transcription?: string | null;
843
+
844
+ /**
845
+ * summary of the video
846
+ */
847
+ summary?: string | null;
848
+
849
+ /**
850
+ * Model for video URL validation.
851
+ */
852
+ video_url?: ScoredVideoURLInputChunk.VideoURL | null;
853
+ }
854
+
855
+ export namespace ScoredVideoURLInputChunk {
856
+ export interface MarkdownChunkGeneratedMetadata {
857
+ type?: 'markdown';
858
+
859
+ file_type?: 'text/markdown';
860
+
861
+ language: string;
862
+
863
+ word_count: number;
864
+
865
+ file_size: number;
866
+
867
+ chunk_headings?: Array<MarkdownChunkGeneratedMetadata.ChunkHeading>;
868
+
869
+ heading_context?: Array<MarkdownChunkGeneratedMetadata.HeadingContext>;
870
+
871
+ start_line?: number;
872
+
873
+ num_lines?: number;
874
+
875
+ frontmatter?: { [key: string]: unknown };
876
+
877
+ [k: string]: unknown;
878
+ }
879
+
880
+ export namespace MarkdownChunkGeneratedMetadata {
881
+ export interface ChunkHeading {
882
+ level: number;
883
+
884
+ text: string;
885
+ }
886
+
887
+ export interface HeadingContext {
888
+ level: number;
889
+
890
+ text: string;
891
+ }
892
+ }
893
+
894
+ export interface TextChunkGeneratedMetadata {
895
+ type?: 'text';
896
+
897
+ file_type?: 'text/plain';
898
+
899
+ language: string;
900
+
901
+ word_count: number;
902
+
903
+ file_size: number;
904
+
905
+ start_line?: number;
906
+
907
+ num_lines?: number;
908
+
909
+ [k: string]: unknown;
910
+ }
911
+
912
+ export interface PdfChunkGeneratedMetadata {
913
+ type?: 'pdf';
914
+
915
+ file_type?: 'application/pdf';
916
+
917
+ total_pages: number;
918
+
919
+ total_size: number;
920
+
921
+ [k: string]: unknown;
922
+ }
923
+
924
+ export interface CodeChunkGeneratedMetadata {
925
+ type?: 'code';
926
+
927
+ file_type: string;
928
+
929
+ language: string;
930
+
931
+ word_count: number;
932
+
933
+ file_size: number;
934
+
935
+ start_line?: number;
936
+
937
+ num_lines?: number;
938
+
939
+ [k: string]: unknown;
940
+ }
941
+
942
+ export interface AudioChunkGeneratedMetadata {
943
+ type?: 'audio';
944
+
945
+ file_type: string;
946
+
947
+ file_size: number;
948
+
949
+ total_duration_seconds: number;
950
+
951
+ sample_rate: number;
952
+
953
+ channels: number;
954
+
955
+ audio_format: number;
956
+
957
+ [k: string]: unknown;
958
+ }
959
+
960
+ export interface VideoChunkGeneratedMetadata {
961
+ type?: 'video';
962
+
963
+ file_type: string;
964
+
965
+ file_size: number;
966
+
967
+ total_duration_seconds: number;
968
+
969
+ fps: number;
970
+
971
+ width: number;
972
+
973
+ height: number;
974
+
975
+ frame_count: number;
976
+
977
+ [k: string]: unknown;
978
+ }
979
+
980
+ /**
981
+ * Model for video URL validation.
982
+ */
983
+ export interface VideoURL {
984
+ /**
985
+ * The video URL. Can be either a URL or a Data URI.
986
+ */
987
+ url: string;
988
+ }
989
+ }
990
+
142
991
  /**
143
992
  * Model representing a store with its metadata and timestamps.
144
993
  */
@@ -181,7 +1030,7 @@ export interface Store {
181
1030
  /**
182
1031
  * Represents an expiration policy for a store.
183
1032
  */
184
- expires_after?: VectorStoresAPI.ExpiresAfter | null;
1033
+ expires_after?: ExpiresAfter | null;
185
1034
 
186
1035
  /**
187
1036
  * Processing status of the store
@@ -233,6 +1082,13 @@ export namespace Store {
233
1082
  * Contextualize files with metadata
234
1083
  */
235
1084
  contextualization?: boolean | Config.ContextualizationConfig;
1085
+
1086
+ /**
1087
+ * Whether to save original content in the store. When False, only vectors are
1088
+ * indexed without the original content (index-only mode). This is useful for data
1089
+ * privacy. Note: Reranking is not supported when content is not saved.
1090
+ */
1091
+ save_content?: boolean;
236
1092
  }
237
1093
 
238
1094
  export namespace Config {
@@ -301,7 +1157,7 @@ export interface StoreChunkSearchOptions {
301
1157
  * Whether to rerank results and optional reranking configuration. Ignored when
302
1158
  * agentic is enabled (the agent handles ranking).
303
1159
  */
304
- rerank?: boolean | VectorStoresFilesAPI.RerankConfig | null;
1160
+ rerank?: boolean | StoreChunkSearchOptions.RerankConfig | null;
305
1161
 
306
1162
  /**
307
1163
  * Whether to use agentic multi-query search with automatic query decomposition and
@@ -321,6 +1177,27 @@ export interface StoreChunkSearchOptions {
321
1177
  }
322
1178
 
323
1179
  export namespace StoreChunkSearchOptions {
1180
+ /**
1181
+ * Represents a reranking configuration.
1182
+ */
1183
+ export interface RerankConfig {
1184
+ /**
1185
+ * The name of the reranking model
1186
+ */
1187
+ model?: string;
1188
+
1189
+ /**
1190
+ * Whether to include metadata in the reranked results
1191
+ */
1192
+ with_metadata?: boolean | Array<string>;
1193
+
1194
+ /**
1195
+ * Maximum number of results to return after reranking. If None, returns all
1196
+ * reranked results.
1197
+ */
1198
+ top_k?: number | null;
1199
+ }
1200
+
324
1201
  /**
325
1202
  * Configuration for agentic multi-query search.
326
1203
  */
@@ -385,10 +1262,7 @@ export interface StoreQuestionAnsweringResponse {
385
1262
  * Source documents used to generate the answer
386
1263
  */
387
1264
  sources?: Array<
388
- | VectorStoresAPI.ScoredTextInputChunk
389
- | VectorStoresAPI.ScoredImageURLInputChunk
390
- | VectorStoresAPI.ScoredAudioURLInputChunk
391
- | VectorStoresAPI.ScoredVideoURLInputChunk
1265
+ ScoredTextInputChunk | ScoredImageURLInputChunk | ScoredAudioURLInputChunk | ScoredVideoURLInputChunk
392
1266
  >;
393
1267
  }
394
1268
 
@@ -402,10 +1276,7 @@ export interface StoreSearchResponse {
402
1276
  * The list of scored store file chunks
403
1277
  */
404
1278
  data: Array<
405
- | VectorStoresAPI.ScoredTextInputChunk
406
- | VectorStoresAPI.ScoredImageURLInputChunk
407
- | VectorStoresAPI.ScoredAudioURLInputChunk
408
- | VectorStoresAPI.ScoredVideoURLInputChunk
1279
+ ScoredTextInputChunk | ScoredImageURLInputChunk | ScoredAudioURLInputChunk | ScoredVideoURLInputChunk
409
1280
  >;
410
1281
  }
411
1282
 
@@ -429,7 +1300,7 @@ export interface StoreCreateParams {
429
1300
  /**
430
1301
  * Represents an expiration policy for a store.
431
1302
  */
432
- expires_after?: VectorStoresAPI.ExpiresAfter | null;
1303
+ expires_after?: ExpiresAfter | null;
433
1304
 
434
1305
  /**
435
1306
  * Optional metadata key-value pairs
@@ -456,6 +1327,13 @@ export namespace StoreCreateParams {
456
1327
  * Contextualize files with metadata
457
1328
  */
458
1329
  contextualization?: boolean | Config.ContextualizationConfig;
1330
+
1331
+ /**
1332
+ * Whether to save original content in the store. When False, only vectors are
1333
+ * indexed without the original content (index-only mode). This is useful for data
1334
+ * privacy. Note: Reranking is not supported when content is not saved.
1335
+ */
1336
+ save_content?: boolean;
459
1337
  }
460
1338
 
461
1339
  export namespace Config {
@@ -490,7 +1368,7 @@ export interface StoreUpdateParams {
490
1368
  /**
491
1369
  * Represents an expiration policy for a store.
492
1370
  */
493
- expires_after?: VectorStoresAPI.ExpiresAfter | null;
1371
+ expires_after?: ExpiresAfter | null;
494
1372
 
495
1373
  /**
496
1374
  * Optional metadata key-value pairs
@@ -614,7 +1492,7 @@ export interface StoreSearchParams {
614
1492
  /**
615
1493
  * Search query text
616
1494
  */
617
- query: string;
1495
+ query: string | ContentAPI.ImageURLInput | ContentAPI.TextInput;
618
1496
 
619
1497
  /**
620
1498
  * IDs or names of stores to search
@@ -650,6 +1528,11 @@ Stores.Files = Files;
650
1528
 
651
1529
  export declare namespace Stores {
652
1530
  export {
1531
+ type ExpiresAfter as ExpiresAfter,
1532
+ type ScoredAudioURLInputChunk as ScoredAudioURLInputChunk,
1533
+ type ScoredImageURLInputChunk as ScoredImageURLInputChunk,
1534
+ type ScoredTextInputChunk as ScoredTextInputChunk,
1535
+ type ScoredVideoURLInputChunk as ScoredVideoURLInputChunk,
653
1536
  type Store as Store,
654
1537
  type StoreChunkSearchOptions as StoreChunkSearchOptions,
655
1538
  type StoreDeleteResponse as StoreDeleteResponse,