@mixedbread/sdk 0.61.0 → 0.63.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 (131) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/client.d.mts +28 -6
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +28 -6
  5. package/client.d.ts.map +1 -1
  6. package/client.js +33 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +33 -0
  9. package/client.mjs.map +1 -1
  10. package/internal/utils/env.js +2 -2
  11. package/internal/utils/env.js.map +1 -1
  12. package/internal/utils/env.mjs +2 -2
  13. package/internal/utils/env.mjs.map +1 -1
  14. package/package.json +1 -1
  15. package/resources/api-keys.d.mts +8 -24
  16. package/resources/api-keys.d.mts.map +1 -1
  17. package/resources/api-keys.d.ts +8 -24
  18. package/resources/api-keys.d.ts.map +1 -1
  19. package/resources/data-sources/connectors.d.mts +55 -0
  20. package/resources/data-sources/connectors.d.mts.map +1 -1
  21. package/resources/data-sources/connectors.d.ts +55 -0
  22. package/resources/data-sources/connectors.d.ts.map +1 -1
  23. package/resources/data-sources/connectors.js +55 -0
  24. package/resources/data-sources/connectors.js.map +1 -1
  25. package/resources/data-sources/connectors.mjs +55 -0
  26. package/resources/data-sources/connectors.mjs.map +1 -1
  27. package/resources/data-sources/data-sources.d.mts +59 -50
  28. package/resources/data-sources/data-sources.d.mts.map +1 -1
  29. package/resources/data-sources/data-sources.d.ts +59 -50
  30. package/resources/data-sources/data-sources.d.ts.map +1 -1
  31. package/resources/data-sources/data-sources.js +37 -0
  32. package/resources/data-sources/data-sources.js.map +1 -1
  33. package/resources/data-sources/data-sources.mjs +37 -0
  34. package/resources/data-sources/data-sources.mjs.map +1 -1
  35. package/resources/data-sources/index.d.mts +1 -1
  36. package/resources/data-sources/index.d.mts.map +1 -1
  37. package/resources/data-sources/index.d.ts +1 -1
  38. package/resources/data-sources/index.d.ts.map +1 -1
  39. package/resources/data-sources/index.js.map +1 -1
  40. package/resources/data-sources/index.mjs.map +1 -1
  41. package/resources/embeddings.d.mts +9 -0
  42. package/resources/embeddings.d.mts.map +1 -1
  43. package/resources/embeddings.d.ts +9 -0
  44. package/resources/embeddings.d.ts.map +1 -1
  45. package/resources/embeddings.js +9 -0
  46. package/resources/embeddings.js.map +1 -1
  47. package/resources/embeddings.mjs +9 -0
  48. package/resources/embeddings.mjs.map +1 -1
  49. package/resources/files/files.d.mts +47 -0
  50. package/resources/files/files.d.mts.map +1 -1
  51. package/resources/files/files.d.ts +47 -0
  52. package/resources/files/files.d.ts.map +1 -1
  53. package/resources/files/files.js +47 -0
  54. package/resources/files/files.js.map +1 -1
  55. package/resources/files/files.mjs +47 -0
  56. package/resources/files/files.mjs.map +1 -1
  57. package/resources/files/uploads.d.mts +36 -0
  58. package/resources/files/uploads.d.mts.map +1 -1
  59. package/resources/files/uploads.d.ts +36 -0
  60. package/resources/files/uploads.d.ts.map +1 -1
  61. package/resources/files/uploads.js +36 -0
  62. package/resources/files/uploads.js.map +1 -1
  63. package/resources/files/uploads.mjs +36 -0
  64. package/resources/files/uploads.mjs.map +1 -1
  65. package/resources/index.d.mts +3 -3
  66. package/resources/index.d.mts.map +1 -1
  67. package/resources/index.d.ts +3 -3
  68. package/resources/index.d.ts.map +1 -1
  69. package/resources/index.js.map +1 -1
  70. package/resources/index.mjs.map +1 -1
  71. package/resources/parsing/index.d.mts +1 -1
  72. package/resources/parsing/index.d.mts.map +1 -1
  73. package/resources/parsing/index.d.ts +1 -1
  74. package/resources/parsing/index.d.ts.map +1 -1
  75. package/resources/parsing/index.js.map +1 -1
  76. package/resources/parsing/index.mjs.map +1 -1
  77. package/resources/parsing/jobs.d.mts +78 -85
  78. package/resources/parsing/jobs.d.mts.map +1 -1
  79. package/resources/parsing/jobs.d.ts +78 -85
  80. package/resources/parsing/jobs.d.ts.map +1 -1
  81. package/resources/parsing/jobs.js.map +1 -1
  82. package/resources/parsing/jobs.mjs.map +1 -1
  83. package/resources/parsing/parsing.d.mts +2 -2
  84. package/resources/parsing/parsing.d.mts.map +1 -1
  85. package/resources/parsing/parsing.d.ts +2 -2
  86. package/resources/parsing/parsing.d.ts.map +1 -1
  87. package/resources/parsing/parsing.js.map +1 -1
  88. package/resources/parsing/parsing.mjs.map +1 -1
  89. package/resources/stores/files.d.mts +155 -740
  90. package/resources/stores/files.d.mts.map +1 -1
  91. package/resources/stores/files.d.ts +155 -740
  92. package/resources/stores/files.d.ts.map +1 -1
  93. package/resources/stores/files.js +39 -12
  94. package/resources/stores/files.js.map +1 -1
  95. package/resources/stores/files.mjs +39 -12
  96. package/resources/stores/files.mjs.map +1 -1
  97. package/resources/stores/index.d.mts +2 -2
  98. package/resources/stores/index.d.mts.map +1 -1
  99. package/resources/stores/index.d.ts +2 -2
  100. package/resources/stores/index.d.ts.map +1 -1
  101. package/resources/stores/index.js.map +1 -1
  102. package/resources/stores/index.mjs.map +1 -1
  103. package/resources/stores/stores.d.mts +294 -532
  104. package/resources/stores/stores.d.mts.map +1 -1
  105. package/resources/stores/stores.d.ts +294 -532
  106. package/resources/stores/stores.d.ts.map +1 -1
  107. package/resources/stores/stores.js +56 -0
  108. package/resources/stores/stores.js.map +1 -1
  109. package/resources/stores/stores.mjs +56 -0
  110. package/resources/stores/stores.mjs.map +1 -1
  111. package/src/client.ts +72 -0
  112. package/src/internal/utils/env.ts +2 -2
  113. package/src/resources/api-keys.ts +8 -29
  114. package/src/resources/data-sources/connectors.ts +55 -0
  115. package/src/resources/data-sources/data-sources.ts +63 -56
  116. package/src/resources/data-sources/index.ts +2 -0
  117. package/src/resources/embeddings.ts +9 -0
  118. package/src/resources/files/files.ts +47 -0
  119. package/src/resources/files/uploads.ts +36 -0
  120. package/src/resources/index.ts +19 -0
  121. package/src/resources/parsing/index.ts +4 -1
  122. package/src/resources/parsing/jobs.ts +96 -100
  123. package/src/resources/parsing/parsing.ts +7 -1
  124. package/src/resources/stores/files.ts +332 -1243
  125. package/src/resources/stores/index.ts +22 -4
  126. package/src/resources/stores/stores.ts +433 -851
  127. package/src/version.ts +1 -1
  128. package/version.d.mts +1 -1
  129. package/version.d.ts +1 -1
  130. package/version.js +1 -1
  131. package/version.mjs +1 -1
@@ -2,7 +2,6 @@
2
2
 
3
3
  import { APIResource } from '../../core/resource';
4
4
  import * as Shared from '../shared';
5
- import * as ContentAPI from '../extractions/content';
6
5
  import * as StoresAPI from './stores';
7
6
  import { APIPromise } from '../../core/api-promise';
8
7
  import { RequestOptions } from '../../internal/request-options';
@@ -19,6 +18,14 @@ export class Files extends APIResource {
19
18
  * to add to the store.
20
19
  *
21
20
  * Returns: VectorStoreFile: The uploaded file details.
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * const storeFile = await client.stores.files.create(
25
+ * 'store_identifier',
26
+ * { file_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },
27
+ * );
28
+ * ```
22
29
  */
23
30
  create(storeIdentifier: string, body: FileCreateParams, options?: RequestOptions): APIPromise<StoreFile> {
24
31
  return this._client.post(path`/v1/stores/${storeIdentifier}/files`, { body, ...options });
@@ -31,6 +38,14 @@ export class Files extends APIResource {
31
38
  * the file. options: Get file options.
32
39
  *
33
40
  * Returns: VectorStoreFile: The file details.
41
+ *
42
+ * @example
43
+ * ```ts
44
+ * const storeFile = await client.stores.files.retrieve(
45
+ * 'file_identifier',
46
+ * { store_identifier: 'store_identifier' },
47
+ * );
48
+ * ```
34
49
  */
35
50
  retrieve(
36
51
  fileIdentifier: string,
@@ -51,6 +66,14 @@ export class Files extends APIResource {
51
66
  * name of the file to update. update_params: Metadata update payload.
52
67
  *
53
68
  * Returns: StoreFile: The updated file details.
69
+ *
70
+ * @example
71
+ * ```ts
72
+ * const storeFile = await client.stores.files.update(
73
+ * 'file_identifier',
74
+ * { store_identifier: 'store_identifier' },
75
+ * );
76
+ * ```
54
77
  */
55
78
  update(fileIdentifier: string, params: FileUpdateParams, options?: RequestOptions): APIPromise<StoreFile> {
56
79
  const { store_identifier, ...body } = params;
@@ -67,6 +90,13 @@ export class Files extends APIResource {
67
90
  * Pagination parameters and metadata filter
68
91
  *
69
92
  * Returns: VectorStoreFileListResponse: Paginated list of vector store files
93
+ *
94
+ * @example
95
+ * ```ts
96
+ * const files = await client.stores.files.list(
97
+ * 'store_identifier',
98
+ * );
99
+ * ```
70
100
  */
71
101
  list(
72
102
  storeIdentifier: string,
@@ -83,6 +113,14 @@ export class Files extends APIResource {
83
113
  * the file to delete.
84
114
  *
85
115
  * Returns: VectorStoreFileDeleted: The deleted file details.
116
+ *
117
+ * @example
118
+ * ```ts
119
+ * const file = await client.stores.files.delete(
120
+ * 'file_identifier',
121
+ * { store_identifier: 'store_identifier' },
122
+ * );
123
+ * ```
86
124
  */
87
125
  delete(
88
126
  fileIdentifier: string,
@@ -93,19 +131,6 @@ export class Files extends APIResource {
93
131
  return this._client.delete(path`/v1/stores/${store_identifier}/files/${fileIdentifier}`, options);
94
132
  }
95
133
 
96
- /**
97
- * Search for files within a store based on semantic similarity.
98
- *
99
- * Args: store_identifier: The ID or name of the store to search within
100
- * search_params: Search configuration including query text, pagination, and
101
- * filters
102
- *
103
- * Returns: StoreFileSearchResponse: List of matching files with relevance scores
104
- */
105
- search(body: FileSearchParams, options?: RequestOptions): APIPromise<FileSearchResponse> {
106
- return this._client.post('/v1/stores/files/search', { body, ...options });
107
- }
108
-
109
134
  /**
110
135
  * Poll for a file's processing status until it reaches a terminal state.
111
136
  *
@@ -382,110 +407,106 @@ export interface FileUploadAndPollHelperParams {
382
407
  multipartUpload?: MultipartUploadConfig | undefined;
383
408
  }
384
409
 
385
- /**
386
- * Represents a scored store file.
387
- */
388
- export interface ScoredStoreFile {
389
- /**
390
- * Unique identifier for the file
391
- */
392
- id: string;
393
-
410
+ export interface AudioURLInputChunk {
394
411
  /**
395
- * Name of the file
412
+ * position of the chunk in a file
396
413
  */
397
- filename?: string;
414
+ chunk_index: number;
398
415
 
399
416
  /**
400
- * Optional file metadata
417
+ * mime type of the chunk
401
418
  */
402
- metadata?: unknown;
419
+ mime_type?: string;
403
420
 
404
421
  /**
405
- * External identifier for this file in the store
422
+ * metadata of the chunk
406
423
  */
407
- external_id?: string | null;
424
+ generated_metadata?:
425
+ | StoresAPI.MarkdownChunkGeneratedMetadata
426
+ | StoresAPI.TextChunkGeneratedMetadata
427
+ | StoresAPI.PdfChunkGeneratedMetadata
428
+ | StoresAPI.CodeChunkGeneratedMetadata
429
+ | StoresAPI.AudioChunkGeneratedMetadata
430
+ | StoresAPI.VideoChunkGeneratedMetadata
431
+ | StoresAPI.ImageChunkGeneratedMetadata
432
+ | null;
408
433
 
409
434
  /**
410
- * Processing status of the file
435
+ * model used for this chunk
411
436
  */
412
- status?: StoreFileStatus;
437
+ model?: string | null;
413
438
 
414
439
  /**
415
- * Last error message if processing failed
440
+ * Input type identifier
416
441
  */
417
- last_error?: unknown;
442
+ type?: 'audio_url';
418
443
 
419
444
  /**
420
- * ID of the containing store
445
+ * speech recognition (sr) text of the audio
421
446
  */
422
- store_id: string;
447
+ transcription?: string | null;
423
448
 
424
449
  /**
425
- * Timestamp of store file creation
450
+ * Model for audio URL validation.
426
451
  */
427
- created_at: string;
452
+ audio_url?: StoresAPI.AudioURL | null;
428
453
 
429
454
  /**
430
- * Version number of the file
455
+ * The sampling rate of the audio.
431
456
  */
432
- version?: number | null;
457
+ sampling_rate: number;
458
+ }
433
459
 
460
+ export interface ImageURLInputChunk {
434
461
  /**
435
- * Storage usage in bytes
462
+ * position of the chunk in a file
436
463
  */
437
- usage_bytes?: number | null;
464
+ chunk_index: number;
438
465
 
439
466
  /**
440
- * Storage usage in tokens
467
+ * mime type of the chunk
441
468
  */
442
- usage_tokens?: number | null;
469
+ mime_type?: string;
443
470
 
444
471
  /**
445
- * Configuration for a file.
472
+ * metadata of the chunk
446
473
  */
447
- config?: ScoredStoreFile.Config | null;
474
+ generated_metadata?:
475
+ | StoresAPI.MarkdownChunkGeneratedMetadata
476
+ | StoresAPI.TextChunkGeneratedMetadata
477
+ | StoresAPI.PdfChunkGeneratedMetadata
478
+ | StoresAPI.CodeChunkGeneratedMetadata
479
+ | StoresAPI.AudioChunkGeneratedMetadata
480
+ | StoresAPI.VideoChunkGeneratedMetadata
481
+ | StoresAPI.ImageChunkGeneratedMetadata
482
+ | null;
448
483
 
449
484
  /**
450
- * Type of the object
485
+ * model used for this chunk
451
486
  */
452
- object?: 'store.file';
487
+ model?: string | null;
453
488
 
454
489
  /**
455
- * Array of scored file chunks
490
+ * Input type identifier
456
491
  */
457
- chunks: Array<
458
- | StoresAPI.ScoredTextInputChunk
459
- | StoresAPI.ScoredImageURLInputChunk
460
- | StoresAPI.ScoredAudioURLInputChunk
461
- | StoresAPI.ScoredVideoURLInputChunk
462
- > | null;
492
+ type?: 'image_url';
463
493
 
464
494
  /**
465
- * Presigned URL for file content
495
+ * ocr text of the image
466
496
  */
467
- content_url: string;
497
+ ocr_text?: string | null;
468
498
 
469
499
  /**
470
- * score of the file
500
+ * summary of the image
471
501
  */
472
- score: number;
473
- }
502
+ summary?: string | null;
474
503
 
475
- export namespace ScoredStoreFile {
476
504
  /**
477
- * Configuration for a file.
505
+ * Model for image URL validation.
478
506
  */
479
- export interface Config {
480
- /**
481
- * Strategy for adding the file, this overrides the store-level default
482
- */
483
- parsing_strategy?: 'fast' | 'high_quality';
484
- }
507
+ image_url?: StoresAPI.ImageURLOutput | null;
485
508
  }
486
509
 
487
- export type StoreFileStatus = 'pending' | 'in_progress' | 'cancelled' | 'completed' | 'failed';
488
-
489
510
  /**
490
511
  * Represents a file stored in a store.
491
512
  */
@@ -548,7 +569,7 @@ export interface StoreFile {
548
569
  /**
549
570
  * Configuration for a file.
550
571
  */
551
- config?: StoreFile.Config | null;
572
+ config?: StoreFileConfig | null;
552
573
 
553
574
  /**
554
575
  * Type of the object
@@ -558,12 +579,7 @@ export interface StoreFile {
558
579
  /**
559
580
  * chunks
560
581
  */
561
- chunks?: Array<
562
- | StoreFile.TextInputChunk
563
- | StoreFile.ImageURLInputChunk
564
- | StoreFile.AudioURLInputChunk
565
- | StoreFile.VideoURLInputChunk
566
- > | null;
582
+ chunks?: Array<TextInputChunk | ImageURLInputChunk | AudioURLInputChunk | VideoURLInputChunk> | null;
567
583
 
568
584
  /**
569
585
  * Presigned URL for file content
@@ -571,1085 +587,286 @@ export interface StoreFile {
571
587
  content_url: string;
572
588
  }
573
589
 
574
- export namespace StoreFile {
590
+ /**
591
+ * Configuration for a file.
592
+ */
593
+ export interface StoreFileConfig {
575
594
  /**
576
- * Configuration for a file.
595
+ * Strategy for adding the file, this overrides the store-level default
577
596
  */
578
- export interface Config {
579
- /**
580
- * Strategy for adding the file, this overrides the store-level default
581
- */
582
- parsing_strategy?: 'fast' | 'high_quality';
583
- }
584
-
585
- export interface TextInputChunk {
586
- /**
587
- * position of the chunk in a file
588
- */
589
- chunk_index: number;
590
-
591
- /**
592
- * mime type of the chunk
593
- */
594
- mime_type?: string;
595
-
596
- /**
597
- * metadata of the chunk
598
- */
599
- generated_metadata?:
600
- | TextInputChunk.MarkdownChunkGeneratedMetadata
601
- | TextInputChunk.TextChunkGeneratedMetadata
602
- | TextInputChunk.PdfChunkGeneratedMetadata
603
- | TextInputChunk.CodeChunkGeneratedMetadata
604
- | TextInputChunk.AudioChunkGeneratedMetadata
605
- | TextInputChunk.VideoChunkGeneratedMetadata
606
- | TextInputChunk.ImageChunkGeneratedMetadata
607
- | null;
608
-
609
- /**
610
- * model used for this chunk
611
- */
612
- model?: string | null;
597
+ parsing_strategy?: 'fast' | 'high_quality';
598
+ }
613
599
 
614
- /**
615
- * Input type identifier
616
- */
617
- type?: 'text';
600
+ export type StoreFileStatus = 'pending' | 'in_progress' | 'cancelled' | 'completed' | 'failed';
618
601
 
619
- /**
620
- * The offset of the text in the file relative to the start of the file.
621
- */
622
- offset?: number;
602
+ export interface TextInputChunk {
603
+ /**
604
+ * position of the chunk in a file
605
+ */
606
+ chunk_index: number;
623
607
 
624
- /**
625
- * Text content
626
- */
627
- text?: string | null;
628
- }
608
+ /**
609
+ * mime type of the chunk
610
+ */
611
+ mime_type?: string;
629
612
 
630
- export namespace TextInputChunk {
631
- export interface MarkdownChunkGeneratedMetadata {
632
- type?: 'markdown';
613
+ /**
614
+ * metadata of the chunk
615
+ */
616
+ generated_metadata?:
617
+ | StoresAPI.MarkdownChunkGeneratedMetadata
618
+ | StoresAPI.TextChunkGeneratedMetadata
619
+ | StoresAPI.PdfChunkGeneratedMetadata
620
+ | StoresAPI.CodeChunkGeneratedMetadata
621
+ | StoresAPI.AudioChunkGeneratedMetadata
622
+ | StoresAPI.VideoChunkGeneratedMetadata
623
+ | StoresAPI.ImageChunkGeneratedMetadata
624
+ | null;
633
625
 
634
- file_type?: 'text/markdown';
626
+ /**
627
+ * model used for this chunk
628
+ */
629
+ model?: string | null;
635
630
 
636
- language?: string | null;
631
+ /**
632
+ * Input type identifier
633
+ */
634
+ type?: 'text';
637
635
 
638
- word_count?: number | null;
636
+ /**
637
+ * The offset of the text in the file relative to the start of the file.
638
+ */
639
+ offset?: number;
639
640
 
640
- file_size?: number | null;
641
+ /**
642
+ * Text content
643
+ */
644
+ text?: string | null;
641
645
 
642
- chunk_headings?: Array<MarkdownChunkGeneratedMetadata.ChunkHeading>;
646
+ /**
647
+ * LLM-generated context that situates this chunk within its source document
648
+ */
649
+ context?: string | null;
650
+ }
643
651
 
644
- heading_context?: Array<MarkdownChunkGeneratedMetadata.HeadingContext>;
652
+ export interface VideoURLInputChunk {
653
+ /**
654
+ * position of the chunk in a file
655
+ */
656
+ chunk_index: number;
645
657
 
646
- start_line?: number;
658
+ /**
659
+ * mime type of the chunk
660
+ */
661
+ mime_type?: string;
647
662
 
648
- num_lines?: number;
663
+ /**
664
+ * metadata of the chunk
665
+ */
666
+ generated_metadata?:
667
+ | StoresAPI.MarkdownChunkGeneratedMetadata
668
+ | StoresAPI.TextChunkGeneratedMetadata
669
+ | StoresAPI.PdfChunkGeneratedMetadata
670
+ | StoresAPI.CodeChunkGeneratedMetadata
671
+ | StoresAPI.AudioChunkGeneratedMetadata
672
+ | StoresAPI.VideoChunkGeneratedMetadata
673
+ | StoresAPI.ImageChunkGeneratedMetadata
674
+ | null;
649
675
 
650
- file_extension?: string | null;
676
+ /**
677
+ * model used for this chunk
678
+ */
679
+ model?: string | null;
651
680
 
652
- frontmatter?: { [key: string]: unknown };
681
+ /**
682
+ * Input type identifier
683
+ */
684
+ type?: 'video_url';
653
685
 
654
- [k: string]: unknown;
655
- }
686
+ /**
687
+ * speech recognition (sr) text of the video
688
+ */
689
+ transcription?: string | null;
656
690
 
657
- export namespace MarkdownChunkGeneratedMetadata {
658
- export interface ChunkHeading {
659
- level: number;
691
+ /**
692
+ * summary of the video
693
+ */
694
+ summary?: string | null;
660
695
 
661
- text: string;
662
- }
696
+ /**
697
+ * Model for video URL validation.
698
+ */
699
+ video_url?: StoresAPI.VideoURL | null;
700
+ }
663
701
 
664
- export interface HeadingContext {
665
- level: number;
702
+ export interface FileListResponse {
703
+ /**
704
+ * Response model for cursor-based pagination.
705
+ */
706
+ pagination: FileListResponse.Pagination;
666
707
 
667
- text: string;
668
- }
669
- }
708
+ /**
709
+ * The object type of the response
710
+ */
711
+ object?: 'list';
670
712
 
671
- export interface TextChunkGeneratedMetadata {
672
- type?: 'text';
713
+ /**
714
+ * The list of store files
715
+ */
716
+ data: Array<StoreFile>;
717
+ }
673
718
 
674
- file_type?: 'text/plain';
719
+ export namespace FileListResponse {
720
+ /**
721
+ * Response model for cursor-based pagination.
722
+ */
723
+ export interface Pagination {
724
+ /**
725
+ * Contextual direction-aware flag: True if more items exist in the requested
726
+ * pagination direction. For 'after': more items after this page. For 'before':
727
+ * more items before this page.
728
+ */
729
+ has_more: boolean;
675
730
 
676
- language?: string | null;
731
+ /**
732
+ * Cursor of the first item in this page. Use for backward pagination. None if page
733
+ * is empty.
734
+ */
735
+ first_cursor: string | null;
677
736
 
678
- word_count?: number | null;
737
+ /**
738
+ * Cursor of the last item in this page. Use for forward pagination. None if page
739
+ * is empty.
740
+ */
741
+ last_cursor: string | null;
679
742
 
680
- file_size?: number | null;
743
+ /**
744
+ * Total number of items available across all pages. Only included when
745
+ * include_total=true was requested. Expensive operation - use sparingly.
746
+ */
747
+ total?: number | null;
748
+ }
749
+ }
681
750
 
682
- start_line?: number;
751
+ /**
752
+ * Response model for file deletion.
753
+ */
754
+ export interface FileDeleteResponse {
755
+ /**
756
+ * ID of the deleted file
757
+ */
758
+ id: string;
683
759
 
684
- num_lines?: number;
760
+ /**
761
+ * Whether the deletion was successful
762
+ */
763
+ deleted?: boolean;
685
764
 
686
- file_extension?: string | null;
765
+ /**
766
+ * Type of the deleted object
767
+ */
768
+ object?: 'store.file';
769
+ }
687
770
 
688
- [k: string]: unknown;
689
- }
771
+ export interface FileCreateParams {
772
+ /**
773
+ * Optional metadata for the file
774
+ */
775
+ metadata?: unknown;
690
776
 
691
- export interface PdfChunkGeneratedMetadata {
692
- type?: 'pdf';
777
+ /**
778
+ * Configuration for adding the file
779
+ */
780
+ config?: StoreFileConfig;
693
781
 
694
- file_type?: 'application/pdf';
782
+ /**
783
+ * External identifier for this file in the store
784
+ */
785
+ external_id?: string | null;
695
786
 
696
- total_pages?: number | null;
787
+ /**
788
+ * If true, overwrite an existing file with the same external_id
789
+ */
790
+ overwrite?: boolean;
697
791
 
698
- total_size?: number | null;
792
+ /**
793
+ * ID of the file to add
794
+ */
795
+ file_id: string;
699
796
 
700
- file_extension?: string | null;
797
+ /**
798
+ * Configuration for a file.
799
+ */
800
+ experimental?: StoreFileConfig | null;
801
+ }
701
802
 
702
- [k: string]: unknown;
703
- }
803
+ export interface FileRetrieveParams {
804
+ /**
805
+ * Path param: The ID or name of the store
806
+ */
807
+ store_identifier: string;
704
808
 
705
- export interface CodeChunkGeneratedMetadata {
706
- type?: 'code';
809
+ /**
810
+ * Query param: Whether to return the chunks for the file. If a list of integers is
811
+ * provided, only the chunks at the specified indices will be returned.
812
+ */
813
+ return_chunks?: boolean | Array<number>;
814
+ }
707
815
 
708
- file_type: string;
816
+ export interface FileUpdateParams {
817
+ /**
818
+ * Path param: The ID or name of the store
819
+ */
820
+ store_identifier: string;
709
821
 
710
- language?: string | null;
822
+ /**
823
+ * Body param: Updated metadata for the file
824
+ */
825
+ metadata?: { [key: string]: unknown } | null;
826
+ }
711
827
 
712
- word_count?: number | null;
828
+ export interface FileListParams {
829
+ /**
830
+ * Maximum number of items to return per page (1-100)
831
+ */
832
+ limit?: number;
713
833
 
714
- file_size?: number | null;
834
+ /**
835
+ * Cursor for forward pagination - get items after this position. Use last_cursor
836
+ * from previous response.
837
+ */
838
+ after?: string | null;
715
839
 
716
- start_line?: number;
840
+ /**
841
+ * Cursor for backward pagination - get items before this position. Use
842
+ * first_cursor from previous response.
843
+ */
844
+ before?: string | null;
717
845
 
718
- num_lines?: number;
846
+ /**
847
+ * Whether to include total count in response (expensive operation)
848
+ */
849
+ include_total?: boolean;
719
850
 
720
- file_extension?: string | null;
851
+ /**
852
+ * Status to filter by
853
+ */
854
+ statuses?: Array<StoreFileStatus> | null;
721
855
 
722
- [k: string]: unknown;
723
- }
856
+ /**
857
+ * Metadata filter to apply to the query
858
+ */
859
+ metadata_filter?:
860
+ | Shared.SearchFilter
861
+ | Shared.SearchFilterCondition
862
+ | Array<Shared.SearchFilter | Shared.SearchFilterCondition>
863
+ | null;
724
864
 
725
- export interface AudioChunkGeneratedMetadata {
726
- type?: 'audio';
727
-
728
- file_type?: string;
729
-
730
- file_size?: number | null;
731
-
732
- total_duration_seconds?: number | null;
733
-
734
- sample_rate?: number | null;
735
-
736
- channels?: number | null;
737
-
738
- audio_format?: number | null;
739
-
740
- bpm?: number | null;
741
-
742
- file_extension?: string | null;
743
-
744
- [k: string]: unknown;
745
- }
746
-
747
- export interface VideoChunkGeneratedMetadata {
748
- type?: 'video';
749
-
750
- file_type?: string;
751
-
752
- file_size?: number | null;
753
-
754
- total_duration_seconds?: number | null;
755
-
756
- fps?: number | null;
757
-
758
- width?: number | null;
759
-
760
- height?: number | null;
761
-
762
- frame_count?: number | null;
763
-
764
- has_audio_stream?: boolean;
765
-
766
- bpm?: number | null;
767
-
768
- file_extension?: string | null;
769
-
770
- [k: string]: unknown;
771
- }
772
-
773
- export interface ImageChunkGeneratedMetadata {
774
- type?: 'image';
775
-
776
- file_type?: string;
777
-
778
- file_size?: number | null;
779
-
780
- width?: number | null;
781
-
782
- height?: number | null;
783
-
784
- file_extension?: string | null;
785
-
786
- [k: string]: unknown;
787
- }
788
- }
789
-
790
- export interface ImageURLInputChunk {
791
- /**
792
- * position of the chunk in a file
793
- */
794
- chunk_index: number;
795
-
796
- /**
797
- * mime type of the chunk
798
- */
799
- mime_type?: string;
800
-
801
- /**
802
- * metadata of the chunk
803
- */
804
- generated_metadata?:
805
- | ImageURLInputChunk.MarkdownChunkGeneratedMetadata
806
- | ImageURLInputChunk.TextChunkGeneratedMetadata
807
- | ImageURLInputChunk.PdfChunkGeneratedMetadata
808
- | ImageURLInputChunk.CodeChunkGeneratedMetadata
809
- | ImageURLInputChunk.AudioChunkGeneratedMetadata
810
- | ImageURLInputChunk.VideoChunkGeneratedMetadata
811
- | ImageURLInputChunk.ImageChunkGeneratedMetadata
812
- | null;
813
-
814
- /**
815
- * model used for this chunk
816
- */
817
- model?: string | null;
818
-
819
- /**
820
- * Input type identifier
821
- */
822
- type?: 'image_url';
823
-
824
- /**
825
- * ocr text of the image
826
- */
827
- ocr_text?: string | null;
828
-
829
- /**
830
- * summary of the image
831
- */
832
- summary?: string | null;
833
-
834
- /**
835
- * Model for image URL validation.
836
- */
837
- image_url?: ImageURLInputChunk.ImageURL | null;
838
- }
839
-
840
- export namespace ImageURLInputChunk {
841
- export interface MarkdownChunkGeneratedMetadata {
842
- type?: 'markdown';
843
-
844
- file_type?: 'text/markdown';
845
-
846
- language?: string | null;
847
-
848
- word_count?: number | null;
849
-
850
- file_size?: number | null;
851
-
852
- chunk_headings?: Array<MarkdownChunkGeneratedMetadata.ChunkHeading>;
853
-
854
- heading_context?: Array<MarkdownChunkGeneratedMetadata.HeadingContext>;
855
-
856
- start_line?: number;
857
-
858
- num_lines?: number;
859
-
860
- file_extension?: string | null;
861
-
862
- frontmatter?: { [key: string]: unknown };
863
-
864
- [k: string]: unknown;
865
- }
866
-
867
- export namespace MarkdownChunkGeneratedMetadata {
868
- export interface ChunkHeading {
869
- level: number;
870
-
871
- text: string;
872
- }
873
-
874
- export interface HeadingContext {
875
- level: number;
876
-
877
- text: string;
878
- }
879
- }
880
-
881
- export interface TextChunkGeneratedMetadata {
882
- type?: 'text';
883
-
884
- file_type?: 'text/plain';
885
-
886
- language?: string | null;
887
-
888
- word_count?: number | null;
889
-
890
- file_size?: number | null;
891
-
892
- start_line?: number;
893
-
894
- num_lines?: number;
895
-
896
- file_extension?: string | null;
897
-
898
- [k: string]: unknown;
899
- }
900
-
901
- export interface PdfChunkGeneratedMetadata {
902
- type?: 'pdf';
903
-
904
- file_type?: 'application/pdf';
905
-
906
- total_pages?: number | null;
907
-
908
- total_size?: number | null;
909
-
910
- file_extension?: string | null;
911
-
912
- [k: string]: unknown;
913
- }
914
-
915
- export interface CodeChunkGeneratedMetadata {
916
- type?: 'code';
917
-
918
- file_type: string;
919
-
920
- language?: string | null;
921
-
922
- word_count?: number | null;
923
-
924
- file_size?: number | null;
925
-
926
- start_line?: number;
927
-
928
- num_lines?: number;
929
-
930
- file_extension?: string | null;
931
-
932
- [k: string]: unknown;
933
- }
934
-
935
- export interface AudioChunkGeneratedMetadata {
936
- type?: 'audio';
937
-
938
- file_type?: string;
939
-
940
- file_size?: number | null;
941
-
942
- total_duration_seconds?: number | null;
943
-
944
- sample_rate?: number | null;
945
-
946
- channels?: number | null;
947
-
948
- audio_format?: number | null;
949
-
950
- bpm?: number | null;
951
-
952
- file_extension?: string | null;
953
-
954
- [k: string]: unknown;
955
- }
956
-
957
- export interface VideoChunkGeneratedMetadata {
958
- type?: 'video';
959
-
960
- file_type?: string;
961
-
962
- file_size?: number | null;
963
-
964
- total_duration_seconds?: number | null;
965
-
966
- fps?: number | null;
967
-
968
- width?: number | null;
969
-
970
- height?: number | null;
971
-
972
- frame_count?: number | null;
973
-
974
- has_audio_stream?: boolean;
975
-
976
- bpm?: number | null;
977
-
978
- file_extension?: string | null;
979
-
980
- [k: string]: unknown;
981
- }
982
-
983
- export interface ImageChunkGeneratedMetadata {
984
- type?: 'image';
985
-
986
- file_type?: string;
987
-
988
- file_size?: number | null;
989
-
990
- width?: number | null;
991
-
992
- height?: number | null;
993
-
994
- file_extension?: string | null;
995
-
996
- [k: string]: unknown;
997
- }
998
-
999
- /**
1000
- * Model for image URL validation.
1001
- */
1002
- export interface ImageURL {
1003
- /**
1004
- * The image URL. Can be either a URL or a Data URI.
1005
- */
1006
- url: string;
1007
-
1008
- /**
1009
- * The image format/mimetype
1010
- */
1011
- format?: string;
1012
- }
1013
- }
1014
-
1015
- export interface AudioURLInputChunk {
1016
- /**
1017
- * position of the chunk in a file
1018
- */
1019
- chunk_index: number;
1020
-
1021
- /**
1022
- * mime type of the chunk
1023
- */
1024
- mime_type?: string;
1025
-
1026
- /**
1027
- * metadata of the chunk
1028
- */
1029
- generated_metadata?:
1030
- | AudioURLInputChunk.MarkdownChunkGeneratedMetadata
1031
- | AudioURLInputChunk.TextChunkGeneratedMetadata
1032
- | AudioURLInputChunk.PdfChunkGeneratedMetadata
1033
- | AudioURLInputChunk.CodeChunkGeneratedMetadata
1034
- | AudioURLInputChunk.AudioChunkGeneratedMetadata
1035
- | AudioURLInputChunk.VideoChunkGeneratedMetadata
1036
- | AudioURLInputChunk.ImageChunkGeneratedMetadata
1037
- | null;
1038
-
1039
- /**
1040
- * model used for this chunk
1041
- */
1042
- model?: string | null;
1043
-
1044
- /**
1045
- * Input type identifier
1046
- */
1047
- type?: 'audio_url';
1048
-
1049
- /**
1050
- * speech recognition (sr) text of the audio
1051
- */
1052
- transcription?: string | null;
1053
-
1054
- /**
1055
- * Model for audio URL validation.
1056
- */
1057
- audio_url?: AudioURLInputChunk.AudioURL | null;
1058
-
1059
- /**
1060
- * The sampling rate of the audio.
1061
- */
1062
- sampling_rate: number;
1063
- }
1064
-
1065
- export namespace AudioURLInputChunk {
1066
- export interface MarkdownChunkGeneratedMetadata {
1067
- type?: 'markdown';
1068
-
1069
- file_type?: 'text/markdown';
1070
-
1071
- language?: string | null;
1072
-
1073
- word_count?: number | null;
1074
-
1075
- file_size?: number | null;
1076
-
1077
- chunk_headings?: Array<MarkdownChunkGeneratedMetadata.ChunkHeading>;
1078
-
1079
- heading_context?: Array<MarkdownChunkGeneratedMetadata.HeadingContext>;
1080
-
1081
- start_line?: number;
1082
-
1083
- num_lines?: number;
1084
-
1085
- file_extension?: string | null;
1086
-
1087
- frontmatter?: { [key: string]: unknown };
1088
-
1089
- [k: string]: unknown;
1090
- }
1091
-
1092
- export namespace MarkdownChunkGeneratedMetadata {
1093
- export interface ChunkHeading {
1094
- level: number;
1095
-
1096
- text: string;
1097
- }
1098
-
1099
- export interface HeadingContext {
1100
- level: number;
1101
-
1102
- text: string;
1103
- }
1104
- }
1105
-
1106
- export interface TextChunkGeneratedMetadata {
1107
- type?: 'text';
1108
-
1109
- file_type?: 'text/plain';
1110
-
1111
- language?: string | null;
1112
-
1113
- word_count?: number | null;
1114
-
1115
- file_size?: number | null;
1116
-
1117
- start_line?: number;
1118
-
1119
- num_lines?: number;
1120
-
1121
- file_extension?: string | null;
1122
-
1123
- [k: string]: unknown;
1124
- }
1125
-
1126
- export interface PdfChunkGeneratedMetadata {
1127
- type?: 'pdf';
1128
-
1129
- file_type?: 'application/pdf';
1130
-
1131
- total_pages?: number | null;
1132
-
1133
- total_size?: number | null;
1134
-
1135
- file_extension?: string | null;
1136
-
1137
- [k: string]: unknown;
1138
- }
1139
-
1140
- export interface CodeChunkGeneratedMetadata {
1141
- type?: 'code';
1142
-
1143
- file_type: string;
1144
-
1145
- language?: string | null;
1146
-
1147
- word_count?: number | null;
1148
-
1149
- file_size?: number | null;
1150
-
1151
- start_line?: number;
1152
-
1153
- num_lines?: number;
1154
-
1155
- file_extension?: string | null;
1156
-
1157
- [k: string]: unknown;
1158
- }
1159
-
1160
- export interface AudioChunkGeneratedMetadata {
1161
- type?: 'audio';
1162
-
1163
- file_type?: string;
1164
-
1165
- file_size?: number | null;
1166
-
1167
- total_duration_seconds?: number | null;
1168
-
1169
- sample_rate?: number | null;
1170
-
1171
- channels?: number | null;
1172
-
1173
- audio_format?: number | null;
1174
-
1175
- bpm?: number | null;
1176
-
1177
- file_extension?: string | null;
1178
-
1179
- [k: string]: unknown;
1180
- }
1181
-
1182
- export interface VideoChunkGeneratedMetadata {
1183
- type?: 'video';
1184
-
1185
- file_type?: string;
1186
-
1187
- file_size?: number | null;
1188
-
1189
- total_duration_seconds?: number | null;
1190
-
1191
- fps?: number | null;
1192
-
1193
- width?: number | null;
1194
-
1195
- height?: number | null;
1196
-
1197
- frame_count?: number | null;
1198
-
1199
- has_audio_stream?: boolean;
1200
-
1201
- bpm?: number | null;
1202
-
1203
- file_extension?: string | null;
1204
-
1205
- [k: string]: unknown;
1206
- }
1207
-
1208
- export interface ImageChunkGeneratedMetadata {
1209
- type?: 'image';
1210
-
1211
- file_type?: string;
1212
-
1213
- file_size?: number | null;
1214
-
1215
- width?: number | null;
1216
-
1217
- height?: number | null;
1218
-
1219
- file_extension?: string | null;
1220
-
1221
- [k: string]: unknown;
1222
- }
1223
-
1224
- /**
1225
- * Model for audio URL validation.
1226
- */
1227
- export interface AudioURL {
1228
- /**
1229
- * The audio URL. Can be either a URL or a Data URI.
1230
- */
1231
- url: string;
1232
- }
1233
- }
1234
-
1235
- export interface VideoURLInputChunk {
1236
- /**
1237
- * position of the chunk in a file
1238
- */
1239
- chunk_index: number;
1240
-
1241
- /**
1242
- * mime type of the chunk
1243
- */
1244
- mime_type?: string;
1245
-
1246
- /**
1247
- * metadata of the chunk
1248
- */
1249
- generated_metadata?:
1250
- | VideoURLInputChunk.MarkdownChunkGeneratedMetadata
1251
- | VideoURLInputChunk.TextChunkGeneratedMetadata
1252
- | VideoURLInputChunk.PdfChunkGeneratedMetadata
1253
- | VideoURLInputChunk.CodeChunkGeneratedMetadata
1254
- | VideoURLInputChunk.AudioChunkGeneratedMetadata
1255
- | VideoURLInputChunk.VideoChunkGeneratedMetadata
1256
- | VideoURLInputChunk.ImageChunkGeneratedMetadata
1257
- | null;
1258
-
1259
- /**
1260
- * model used for this chunk
1261
- */
1262
- model?: string | null;
1263
-
1264
- /**
1265
- * Input type identifier
1266
- */
1267
- type?: 'video_url';
1268
-
1269
- /**
1270
- * speech recognition (sr) text of the video
1271
- */
1272
- transcription?: string | null;
1273
-
1274
- /**
1275
- * Model for video URL validation.
1276
- */
1277
- video_url?: VideoURLInputChunk.VideoURL | null;
1278
- }
1279
-
1280
- export namespace VideoURLInputChunk {
1281
- export interface MarkdownChunkGeneratedMetadata {
1282
- type?: 'markdown';
1283
-
1284
- file_type?: 'text/markdown';
1285
-
1286
- language?: string | null;
1287
-
1288
- word_count?: number | null;
1289
-
1290
- file_size?: number | null;
1291
-
1292
- chunk_headings?: Array<MarkdownChunkGeneratedMetadata.ChunkHeading>;
1293
-
1294
- heading_context?: Array<MarkdownChunkGeneratedMetadata.HeadingContext>;
1295
-
1296
- start_line?: number;
1297
-
1298
- num_lines?: number;
1299
-
1300
- file_extension?: string | null;
1301
-
1302
- frontmatter?: { [key: string]: unknown };
1303
-
1304
- [k: string]: unknown;
1305
- }
1306
-
1307
- export namespace MarkdownChunkGeneratedMetadata {
1308
- export interface ChunkHeading {
1309
- level: number;
1310
-
1311
- text: string;
1312
- }
1313
-
1314
- export interface HeadingContext {
1315
- level: number;
1316
-
1317
- text: string;
1318
- }
1319
- }
1320
-
1321
- export interface TextChunkGeneratedMetadata {
1322
- type?: 'text';
1323
-
1324
- file_type?: 'text/plain';
1325
-
1326
- language?: string | null;
1327
-
1328
- word_count?: number | null;
1329
-
1330
- file_size?: number | null;
1331
-
1332
- start_line?: number;
1333
-
1334
- num_lines?: number;
1335
-
1336
- file_extension?: string | null;
1337
-
1338
- [k: string]: unknown;
1339
- }
1340
-
1341
- export interface PdfChunkGeneratedMetadata {
1342
- type?: 'pdf';
1343
-
1344
- file_type?: 'application/pdf';
1345
-
1346
- total_pages?: number | null;
1347
-
1348
- total_size?: number | null;
1349
-
1350
- file_extension?: string | null;
1351
-
1352
- [k: string]: unknown;
1353
- }
1354
-
1355
- export interface CodeChunkGeneratedMetadata {
1356
- type?: 'code';
1357
-
1358
- file_type: string;
1359
-
1360
- language?: string | null;
1361
-
1362
- word_count?: number | null;
1363
-
1364
- file_size?: number | null;
1365
-
1366
- start_line?: number;
1367
-
1368
- num_lines?: number;
1369
-
1370
- file_extension?: string | null;
1371
-
1372
- [k: string]: unknown;
1373
- }
1374
-
1375
- export interface AudioChunkGeneratedMetadata {
1376
- type?: 'audio';
1377
-
1378
- file_type?: string;
1379
-
1380
- file_size?: number | null;
1381
-
1382
- total_duration_seconds?: number | null;
1383
-
1384
- sample_rate?: number | null;
1385
-
1386
- channels?: number | null;
1387
-
1388
- audio_format?: number | null;
1389
-
1390
- bpm?: number | null;
1391
-
1392
- file_extension?: string | null;
1393
-
1394
- [k: string]: unknown;
1395
- }
1396
-
1397
- export interface VideoChunkGeneratedMetadata {
1398
- type?: 'video';
1399
-
1400
- file_type?: string;
1401
-
1402
- file_size?: number | null;
1403
-
1404
- total_duration_seconds?: number | null;
1405
-
1406
- fps?: number | null;
1407
-
1408
- width?: number | null;
1409
-
1410
- height?: number | null;
1411
-
1412
- frame_count?: number | null;
1413
-
1414
- has_audio_stream?: boolean;
1415
-
1416
- bpm?: number | null;
1417
-
1418
- file_extension?: string | null;
1419
-
1420
- [k: string]: unknown;
1421
- }
1422
-
1423
- export interface ImageChunkGeneratedMetadata {
1424
- type?: 'image';
1425
-
1426
- file_type?: string;
1427
-
1428
- file_size?: number | null;
1429
-
1430
- width?: number | null;
1431
-
1432
- height?: number | null;
1433
-
1434
- file_extension?: string | null;
1435
-
1436
- [k: string]: unknown;
1437
- }
1438
-
1439
- /**
1440
- * Model for video URL validation.
1441
- */
1442
- export interface VideoURL {
1443
- /**
1444
- * The video URL. Can be either a URL or a Data URI.
1445
- */
1446
- url: string;
1447
- }
1448
- }
1449
- }
1450
-
1451
- export interface FileListResponse {
1452
- /**
1453
- * Response model for cursor-based pagination.
1454
- */
1455
- pagination: FileListResponse.Pagination;
1456
-
1457
- /**
1458
- * The object type of the response
1459
- */
1460
- object?: 'list';
1461
-
1462
- /**
1463
- * The list of store files
1464
- */
1465
- data: Array<StoreFile>;
1466
- }
1467
-
1468
- export namespace FileListResponse {
1469
- /**
1470
- * Response model for cursor-based pagination.
1471
- */
1472
- export interface Pagination {
1473
- /**
1474
- * Contextual direction-aware flag: True if more items exist in the requested
1475
- * pagination direction. For 'after': more items after this page. For 'before':
1476
- * more items before this page.
1477
- */
1478
- has_more: boolean;
1479
-
1480
- /**
1481
- * Cursor of the first item in this page. Use for backward pagination. None if page
1482
- * is empty.
1483
- */
1484
- first_cursor: string | null;
1485
-
1486
- /**
1487
- * Cursor of the last item in this page. Use for forward pagination. None if page
1488
- * is empty.
1489
- */
1490
- last_cursor: string | null;
1491
-
1492
- /**
1493
- * Total number of items available across all pages. Only included when
1494
- * include_total=true was requested. Expensive operation - use sparingly.
1495
- */
1496
- total?: number | null;
1497
- }
1498
- }
1499
-
1500
- /**
1501
- * Response model for file deletion.
1502
- */
1503
- export interface FileDeleteResponse {
1504
- /**
1505
- * ID of the deleted file
1506
- */
1507
- id: string;
1508
-
1509
- /**
1510
- * Whether the deletion was successful
1511
- */
1512
- deleted?: boolean;
1513
-
1514
- /**
1515
- * Type of the deleted object
1516
- */
1517
- object?: 'store.file';
1518
- }
1519
-
1520
- export interface FileSearchResponse {
1521
- /**
1522
- * The object type of the response
1523
- */
1524
- object?: 'list';
1525
-
1526
- /**
1527
- * The list of scored store files
1528
- */
1529
- data: Array<ScoredStoreFile>;
1530
- }
1531
-
1532
- export interface FileCreateParams {
1533
- /**
1534
- * Optional metadata for the file
1535
- */
1536
- metadata?: unknown;
1537
-
1538
- /**
1539
- * Configuration for adding the file
1540
- */
1541
- config?: FileCreateParams.Config;
1542
-
1543
- /**
1544
- * External identifier for this file in the store
1545
- */
1546
- external_id?: string | null;
1547
-
1548
- /**
1549
- * If true, overwrite an existing file with the same external_id
1550
- */
1551
- overwrite?: boolean;
1552
-
1553
- /**
1554
- * ID of the file to add
1555
- */
1556
- file_id: string;
1557
-
1558
- /**
1559
- * @deprecated Configuration for a file.
1560
- */
1561
- experimental?: FileCreateParams.Experimental | null;
1562
- }
1563
-
1564
- export namespace FileCreateParams {
1565
- /**
1566
- * Configuration for adding the file
1567
- */
1568
- export interface Config {
1569
- /**
1570
- * Strategy for adding the file, this overrides the store-level default
1571
- */
1572
- parsing_strategy?: 'fast' | 'high_quality';
1573
- }
1574
-
1575
- /**
1576
- * @deprecated Configuration for a file.
1577
- */
1578
- export interface Experimental {
1579
- /**
1580
- * Strategy for adding the file, this overrides the store-level default
1581
- */
1582
- parsing_strategy?: 'fast' | 'high_quality';
1583
- }
1584
- }
1585
-
1586
- export interface FileRetrieveParams {
1587
- /**
1588
- * Path param: The ID or name of the store
1589
- */
1590
- store_identifier: string;
1591
-
1592
- /**
1593
- * Query param: Whether to return the chunks for the file. If a list of integers is
1594
- * provided, only the chunks at the specified indices will be returned.
1595
- */
1596
- return_chunks?: boolean | Array<number>;
1597
- }
1598
-
1599
- export interface FileUpdateParams {
1600
- /**
1601
- * Path param: The ID or name of the store
1602
- */
1603
- store_identifier: string;
1604
-
1605
- /**
1606
- * Body param: Updated metadata for the file
1607
- */
1608
- metadata?: { [key: string]: unknown } | null;
1609
- }
1610
-
1611
- export interface FileListParams {
1612
- /**
1613
- * Maximum number of items to return per page (1-100)
1614
- */
1615
- limit?: number;
1616
-
1617
- /**
1618
- * Cursor for forward pagination - get items after this position. Use last_cursor
1619
- * from previous response.
1620
- */
1621
- after?: string | null;
1622
-
1623
- /**
1624
- * Cursor for backward pagination - get items before this position. Use
1625
- * first_cursor from previous response.
1626
- */
1627
- before?: string | null;
1628
-
1629
- /**
1630
- * Whether to include total count in response (expensive operation)
1631
- */
1632
- include_total?: boolean;
1633
-
1634
- /**
1635
- * Status to filter by
1636
- */
1637
- statuses?: Array<StoreFileStatus> | null;
1638
-
1639
- /**
1640
- * Metadata filter to apply to the query
1641
- */
1642
- metadata_filter?:
1643
- | Shared.SearchFilter
1644
- | Shared.SearchFilterCondition
1645
- | Array<Shared.SearchFilter | Shared.SearchFilterCondition>
1646
- | null;
1647
-
1648
- /**
1649
- * Search query for fuzzy matching over name and external_id fields
1650
- */
1651
- q?: string | null;
1652
- }
865
+ /**
866
+ * Search query for fuzzy matching over name and external_id fields
867
+ */
868
+ q?: string | null;
869
+ }
1653
870
 
1654
871
  export interface FileDeleteParams {
1655
872
  /**
@@ -1658,149 +875,21 @@ export interface FileDeleteParams {
1658
875
  store_identifier: string;
1659
876
  }
1660
877
 
1661
- export interface FileSearchParams {
1662
- /**
1663
- * Search query text
1664
- */
1665
- query: string | ContentAPI.ImageURLInput | ContentAPI.TextInput;
1666
-
1667
- /**
1668
- * IDs or names of stores to search
1669
- */
1670
- store_identifiers: Array<string>;
1671
-
1672
- /**
1673
- * Number of results to return
1674
- */
1675
- top_k?: number;
1676
-
1677
- /**
1678
- * Optional filter conditions
1679
- */
1680
- filters?:
1681
- | Shared.SearchFilter
1682
- | Shared.SearchFilterCondition
1683
- | Array<Shared.SearchFilter | Shared.SearchFilterCondition>
1684
- | null;
1685
-
1686
- /**
1687
- * Optional list of file IDs to filter chunks by (inclusion filter)
1688
- */
1689
- file_ids?: Array<unknown> | Array<string> | null;
1690
-
1691
- /**
1692
- * Search configuration options
1693
- */
1694
- search_options?: FileSearchParams.SearchOptions;
1695
- }
1696
-
1697
- export namespace FileSearchParams {
1698
- /**
1699
- * Search configuration options
1700
- */
1701
- export interface SearchOptions {
1702
- /**
1703
- * Minimum similarity score threshold
1704
- */
1705
- score_threshold?: number;
1706
-
1707
- /**
1708
- * Whether to rewrite the query. Ignored when agentic is enabled (the agent handles
1709
- * query decomposition).
1710
- */
1711
- rewrite_query?: boolean;
1712
-
1713
- /**
1714
- * Whether to rerank results and optional reranking configuration. Ignored when
1715
- * agentic is enabled (the agent handles ranking).
1716
- */
1717
- rerank?: boolean | SearchOptions.RerankConfig | null;
1718
-
1719
- /**
1720
- * Whether to use agentic multi-query search with automatic query decomposition and
1721
- * ranking. When enabled, rewrite_query and rerank options are ignored.
1722
- */
1723
- agentic?: boolean | SearchOptions.AgenticSearchConfig | null;
1724
-
1725
- /**
1726
- * Whether to return file metadata
1727
- */
1728
- return_metadata?: boolean;
1729
-
1730
- /**
1731
- * Whether to return matching text chunks
1732
- */
1733
- return_chunks?: boolean;
1734
-
1735
- /**
1736
- * Number of chunks to return for each file
1737
- */
1738
- chunks_per_file?: number;
1739
-
1740
- /**
1741
- * Whether to apply search rules
1742
- */
1743
- apply_search_rules?: boolean;
1744
- }
1745
-
1746
- export namespace SearchOptions {
1747
- /**
1748
- * Represents a reranking configuration.
1749
- */
1750
- export interface RerankConfig {
1751
- /**
1752
- * The name of the reranking model
1753
- */
1754
- model?: string;
1755
-
1756
- /**
1757
- * Whether to include metadata in the reranked results
1758
- */
1759
- with_metadata?: boolean | Array<string>;
1760
-
1761
- /**
1762
- * Maximum number of results to return after reranking. If None, returns all
1763
- * reranked results.
1764
- */
1765
- top_k?: number | null;
1766
- }
1767
-
1768
- /**
1769
- * Configuration for agentic multi-query search.
1770
- */
1771
- export interface AgenticSearchConfig {
1772
- /**
1773
- * Maximum number of search rounds
1774
- */
1775
- max_rounds?: number;
1776
-
1777
- /**
1778
- * Maximum queries per round
1779
- */
1780
- queries_per_round?: number;
1781
-
1782
- /**
1783
- * Additional custom instructions (followed only when not in conflict with existing
1784
- * rules)
1785
- */
1786
- instructions?: string | null;
1787
- }
1788
- }
1789
- }
1790
-
1791
878
  export declare namespace Files {
1792
879
  export {
1793
- type ScoredStoreFile as ScoredStoreFile,
1794
- type StoreFileStatus as StoreFileStatus,
880
+ type AudioURLInputChunk as AudioURLInputChunk,
881
+ type ImageURLInputChunk as ImageURLInputChunk,
1795
882
  type StoreFile as StoreFile,
883
+ type StoreFileConfig as StoreFileConfig,
884
+ type StoreFileStatus as StoreFileStatus,
885
+ type TextInputChunk as TextInputChunk,
886
+ type VideoURLInputChunk as VideoURLInputChunk,
1796
887
  type FileListResponse as FileListResponse,
1797
888
  type FileDeleteResponse as FileDeleteResponse,
1798
- type FileSearchResponse as FileSearchResponse,
1799
889
  type FileCreateParams as FileCreateParams,
1800
890
  type FileRetrieveParams as FileRetrieveParams,
1801
891
  type FileUpdateParams as FileUpdateParams,
1802
892
  type FileListParams as FileListParams,
1803
893
  type FileDeleteParams as FileDeleteParams,
1804
- type FileSearchParams as FileSearchParams,
1805
894
  };
1806
895
  }