@mixedbread/sdk 0.60.0 → 0.62.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 +56 -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 +22 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +22 -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 +159 -744
  90. package/resources/stores/files.d.mts.map +1 -1
  91. package/resources/stores/files.d.ts +159 -744
  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 +292 -538
  104. package/resources/stores/stores.d.mts.map +1 -1
  105. package/resources/stores/stores.d.ts +292 -538
  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 +60 -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 +343 -1254
  125. package/src/resources/stores/index.ts +22 -4
  126. package/src/resources/stores/stores.ts +429 -857
  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,105 +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 {
410
+ export interface AudioURLInputChunk {
389
411
  /**
390
- * Unique identifier for the file
412
+ * position of the chunk in a file
391
413
  */
392
- id: string;
414
+ chunk_index: number;
393
415
 
394
416
  /**
395
- * Name of the file
417
+ * mime type of the chunk
396
418
  */
397
- filename?: string;
419
+ mime_type?: string;
398
420
 
399
421
  /**
400
- * Optional file metadata
422
+ * metadata of the chunk
401
423
  */
402
- metadata?: unknown;
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;
403
433
 
404
434
  /**
405
- * External identifier for this file in the store
435
+ * model used for this chunk
406
436
  */
407
- external_id?: string | null;
437
+ model?: string | null;
408
438
 
409
439
  /**
410
- * Processing status of the file
440
+ * Input type identifier
411
441
  */
412
- status?: StoreFileStatus;
442
+ type?: 'audio_url';
413
443
 
414
444
  /**
415
- * Last error message if processing failed
445
+ * speech recognition (sr) text of the audio
416
446
  */
417
- last_error?: unknown;
447
+ transcription?: string | null;
418
448
 
419
449
  /**
420
- * ID of the containing store
450
+ * Model for audio URL validation.
421
451
  */
422
- store_id: string;
452
+ audio_url?: StoresAPI.AudioURL | null;
423
453
 
424
454
  /**
425
- * Timestamp of store file creation
455
+ * The sampling rate of the audio.
426
456
  */
427
- created_at: string;
457
+ sampling_rate: number;
458
+ }
428
459
 
460
+ export interface ImageURLInputChunk {
429
461
  /**
430
- * Version number of the file
462
+ * position of the chunk in a file
431
463
  */
432
- version?: number | null;
464
+ chunk_index: number;
433
465
 
434
466
  /**
435
- * Storage usage in bytes
467
+ * mime type of the chunk
436
468
  */
437
- usage_bytes?: number | null;
469
+ mime_type?: string;
438
470
 
439
471
  /**
440
- * Storage usage in tokens
472
+ * metadata of the chunk
441
473
  */
442
- usage_tokens?: number | 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;
443
483
 
444
484
  /**
445
- * Configuration for a file.
485
+ * model used for this chunk
446
486
  */
447
- config?: ScoredStoreFile.Config | null;
487
+ model?: string | null;
448
488
 
449
489
  /**
450
- * Type of the object
490
+ * Input type identifier
451
491
  */
452
- object?: 'store.file';
492
+ type?: 'image_url';
453
493
 
454
494
  /**
455
- * Array of scored file chunks
495
+ * ocr text of the image
456
496
  */
457
- chunks: Array<
458
- | StoresAPI.ScoredTextInputChunk
459
- | StoresAPI.ScoredImageURLInputChunk
460
- | StoresAPI.ScoredAudioURLInputChunk
461
- | StoresAPI.ScoredVideoURLInputChunk
462
- > | null;
497
+ ocr_text?: string | null;
463
498
 
464
499
  /**
465
- * score of the file
500
+ * summary of the image
466
501
  */
467
- score: number;
468
- }
502
+ summary?: string | null;
469
503
 
470
- export namespace ScoredStoreFile {
471
504
  /**
472
- * Configuration for a file.
505
+ * Model for image URL validation.
473
506
  */
474
- export interface Config {
475
- /**
476
- * Strategy for adding the file, this overrides the store-level default
477
- */
478
- parsing_strategy?: 'fast' | 'high_quality';
479
- }
507
+ image_url?: StoresAPI.ImageURLOutput | null;
480
508
  }
481
509
 
482
- export type StoreFileStatus = 'pending' | 'in_progress' | 'cancelled' | 'completed' | 'failed';
483
-
484
510
  /**
485
511
  * Represents a file stored in a store.
486
512
  */
@@ -543,7 +569,7 @@ export interface StoreFile {
543
569
  /**
544
570
  * Configuration for a file.
545
571
  */
546
- config?: StoreFile.Config | null;
572
+ config?: StoreFileConfig | null;
547
573
 
548
574
  /**
549
575
  * Type of the object
@@ -553,1254 +579,317 @@ export interface StoreFile {
553
579
  /**
554
580
  * chunks
555
581
  */
556
- chunks?: Array<
557
- | StoreFile.TextInputChunk
558
- | StoreFile.ImageURLInputChunk
559
- | StoreFile.AudioURLInputChunk
560
- | StoreFile.VideoURLInputChunk
561
- > | null;
582
+ chunks?: Array<TextInputChunk | ImageURLInputChunk | AudioURLInputChunk | VideoURLInputChunk> | null;
583
+
584
+ /**
585
+ * Presigned URL for file content
586
+ */
587
+ content_url: string;
562
588
  }
563
589
 
564
- export namespace StoreFile {
590
+ /**
591
+ * Configuration for a file.
592
+ */
593
+ export interface StoreFileConfig {
565
594
  /**
566
- * Configuration for a file.
595
+ * Strategy for adding the file, this overrides the store-level default
567
596
  */
568
- export interface Config {
569
- /**
570
- * Strategy for adding the file, this overrides the store-level default
571
- */
572
- parsing_strategy?: 'fast' | 'high_quality';
573
- }
597
+ parsing_strategy?: 'fast' | 'high_quality';
598
+ }
574
599
 
575
- export interface TextInputChunk {
576
- /**
577
- * position of the chunk in a file
578
- */
579
- chunk_index: number;
600
+ export type StoreFileStatus = 'pending' | 'in_progress' | 'cancelled' | 'completed' | 'failed';
580
601
 
581
- /**
582
- * mime type of the chunk
583
- */
584
- mime_type?: string;
602
+ export interface TextInputChunk {
603
+ /**
604
+ * position of the chunk in a file
605
+ */
606
+ chunk_index: number;
585
607
 
586
- /**
587
- * metadata of the chunk
588
- */
589
- generated_metadata?:
590
- | TextInputChunk.MarkdownChunkGeneratedMetadata
591
- | TextInputChunk.TextChunkGeneratedMetadata
592
- | TextInputChunk.PdfChunkGeneratedMetadata
593
- | TextInputChunk.CodeChunkGeneratedMetadata
594
- | TextInputChunk.AudioChunkGeneratedMetadata
595
- | TextInputChunk.VideoChunkGeneratedMetadata
596
- | TextInputChunk.ImageChunkGeneratedMetadata
597
- | null;
608
+ /**
609
+ * mime type of the chunk
610
+ */
611
+ mime_type?: string;
598
612
 
599
- /**
600
- * model used for this chunk
601
- */
602
- model?: string | null;
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;
603
625
 
604
- /**
605
- * Input type identifier
606
- */
607
- type?: 'text';
626
+ /**
627
+ * model used for this chunk
628
+ */
629
+ model?: string | null;
608
630
 
609
- /**
610
- * The offset of the text in the file relative to the start of the file.
611
- */
612
- offset?: number;
631
+ /**
632
+ * Input type identifier
633
+ */
634
+ type?: 'text';
613
635
 
614
- /**
615
- * Text content
616
- */
617
- text?: string | null;
618
- }
636
+ /**
637
+ * The offset of the text in the file relative to the start of the file.
638
+ */
639
+ offset?: number;
619
640
 
620
- export namespace TextInputChunk {
621
- export interface MarkdownChunkGeneratedMetadata {
622
- type?: 'markdown';
641
+ /**
642
+ * Text content
643
+ */
644
+ text?: string | null;
623
645
 
624
- file_type?: 'text/markdown';
646
+ /**
647
+ * LLM-generated context that situates this chunk within its source document
648
+ */
649
+ context?: string | null;
650
+ }
625
651
 
626
- language?: string | null;
652
+ export interface VideoURLInputChunk {
653
+ /**
654
+ * position of the chunk in a file
655
+ */
656
+ chunk_index: number;
627
657
 
628
- word_count?: number | null;
658
+ /**
659
+ * mime type of the chunk
660
+ */
661
+ mime_type?: string;
629
662
 
630
- file_size?: number | null;
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;
631
675
 
632
- chunk_headings?: Array<MarkdownChunkGeneratedMetadata.ChunkHeading>;
676
+ /**
677
+ * model used for this chunk
678
+ */
679
+ model?: string | null;
633
680
 
634
- heading_context?: Array<MarkdownChunkGeneratedMetadata.HeadingContext>;
681
+ /**
682
+ * Input type identifier
683
+ */
684
+ type?: 'video_url';
635
685
 
636
- start_line?: number;
686
+ /**
687
+ * speech recognition (sr) text of the video
688
+ */
689
+ transcription?: string | null;
637
690
 
638
- num_lines?: number;
691
+ /**
692
+ * summary of the video
693
+ */
694
+ summary?: string | null;
639
695
 
640
- file_extension?: string | null;
696
+ /**
697
+ * Model for video URL validation.
698
+ */
699
+ video_url?: StoresAPI.VideoURL | null;
700
+ }
641
701
 
642
- frontmatter?: { [key: string]: unknown };
702
+ export interface FileListResponse {
703
+ /**
704
+ * Response model for cursor-based pagination.
705
+ */
706
+ pagination: FileListResponse.Pagination;
643
707
 
644
- [k: string]: unknown;
645
- }
708
+ /**
709
+ * The object type of the response
710
+ */
711
+ object?: 'list';
646
712
 
647
- export namespace MarkdownChunkGeneratedMetadata {
648
- export interface ChunkHeading {
649
- level: number;
713
+ /**
714
+ * The list of store files
715
+ */
716
+ data: Array<StoreFile>;
717
+ }
650
718
 
651
- text: string;
652
- }
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;
653
730
 
654
- export interface HeadingContext {
655
- level: number;
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;
656
736
 
657
- text: string;
658
- }
659
- }
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;
660
742
 
661
- export interface TextChunkGeneratedMetadata {
662
- type?: 'text';
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
+ }
663
750
 
664
- file_type?: 'text/plain';
751
+ /**
752
+ * Response model for file deletion.
753
+ */
754
+ export interface FileDeleteResponse {
755
+ /**
756
+ * ID of the deleted file
757
+ */
758
+ id: string;
665
759
 
666
- language?: string | null;
760
+ /**
761
+ * Whether the deletion was successful
762
+ */
763
+ deleted?: boolean;
667
764
 
668
- word_count?: number | null;
765
+ /**
766
+ * Type of the deleted object
767
+ */
768
+ object?: 'store.file';
769
+ }
669
770
 
670
- file_size?: number | null;
771
+ export interface FileCreateParams {
772
+ /**
773
+ * Optional metadata for the file
774
+ */
775
+ metadata?: unknown;
671
776
 
672
- start_line?: number;
777
+ /**
778
+ * Configuration for adding the file
779
+ */
780
+ config?: StoreFileConfig;
673
781
 
674
- num_lines?: number;
782
+ /**
783
+ * External identifier for this file in the store
784
+ */
785
+ external_id?: string | null;
675
786
 
676
- file_extension?: string | null;
787
+ /**
788
+ * If true, overwrite an existing file with the same external_id
789
+ */
790
+ overwrite?: boolean;
677
791
 
678
- [k: string]: unknown;
679
- }
792
+ /**
793
+ * ID of the file to add
794
+ */
795
+ file_id: string;
680
796
 
681
- export interface PdfChunkGeneratedMetadata {
682
- type?: 'pdf';
797
+ /**
798
+ * Configuration for a file.
799
+ */
800
+ experimental?: StoreFileConfig | null;
801
+ }
683
802
 
684
- file_type?: 'application/pdf';
803
+ export interface FileRetrieveParams {
804
+ /**
805
+ * Path param: The ID or name of the store
806
+ */
807
+ store_identifier: string;
685
808
 
686
- total_pages?: number | null;
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
+ }
687
815
 
688
- total_size?: number | null;
816
+ export interface FileUpdateParams {
817
+ /**
818
+ * Path param: The ID or name of the store
819
+ */
820
+ store_identifier: string;
689
821
 
690
- file_extension?: string | null;
822
+ /**
823
+ * Body param: Updated metadata for the file
824
+ */
825
+ metadata?: { [key: string]: unknown } | null;
826
+ }
691
827
 
692
- [k: string]: unknown;
693
- }
828
+ export interface FileListParams {
829
+ /**
830
+ * Maximum number of items to return per page (1-100)
831
+ */
832
+ limit?: number;
694
833
 
695
- export interface CodeChunkGeneratedMetadata {
696
- type?: 'code';
834
+ /**
835
+ * Cursor for forward pagination - get items after this position. Use last_cursor
836
+ * from previous response.
837
+ */
838
+ after?: string | null;
697
839
 
698
- file_type: string;
840
+ /**
841
+ * Cursor for backward pagination - get items before this position. Use
842
+ * first_cursor from previous response.
843
+ */
844
+ before?: string | null;
699
845
 
700
- language?: string | null;
846
+ /**
847
+ * Whether to include total count in response (expensive operation)
848
+ */
849
+ include_total?: boolean;
701
850
 
702
- word_count?: number | null;
851
+ /**
852
+ * Status to filter by
853
+ */
854
+ statuses?: Array<StoreFileStatus> | null;
703
855
 
704
- file_size?: number | null;
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;
705
864
 
706
- start_line?: number;
865
+ /**
866
+ * Search query for fuzzy matching over name and external_id fields
867
+ */
868
+ q?: string | null;
869
+ }
707
870
 
708
- num_lines?: number;
709
-
710
- file_extension?: string | null;
711
-
712
- [k: string]: unknown;
713
- }
714
-
715
- export interface AudioChunkGeneratedMetadata {
716
- type?: 'audio';
717
-
718
- file_type?: string;
719
-
720
- file_size?: number | null;
721
-
722
- total_duration_seconds?: number | null;
723
-
724
- sample_rate?: number | null;
725
-
726
- channels?: number | null;
727
-
728
- audio_format?: number | null;
729
-
730
- bpm?: number | null;
731
-
732
- file_extension?: string | null;
733
-
734
- [k: string]: unknown;
735
- }
736
-
737
- export interface VideoChunkGeneratedMetadata {
738
- type?: 'video';
739
-
740
- file_type?: string;
741
-
742
- file_size?: number | null;
743
-
744
- total_duration_seconds?: number | null;
745
-
746
- fps?: number | null;
747
-
748
- width?: number | null;
749
-
750
- height?: number | null;
751
-
752
- frame_count?: number | null;
753
-
754
- has_audio_stream?: boolean;
755
-
756
- bpm?: number | null;
757
-
758
- file_extension?: string | null;
759
-
760
- [k: string]: unknown;
761
- }
762
-
763
- export interface ImageChunkGeneratedMetadata {
764
- type?: 'image';
765
-
766
- file_type?: string;
767
-
768
- file_size?: number | null;
769
-
770
- width?: number | null;
771
-
772
- height?: number | null;
773
-
774
- file_extension?: string | null;
775
-
776
- [k: string]: unknown;
777
- }
778
- }
779
-
780
- export interface ImageURLInputChunk {
781
- /**
782
- * position of the chunk in a file
783
- */
784
- chunk_index: number;
785
-
786
- /**
787
- * mime type of the chunk
788
- */
789
- mime_type?: string;
790
-
791
- /**
792
- * metadata of the chunk
793
- */
794
- generated_metadata?:
795
- | ImageURLInputChunk.MarkdownChunkGeneratedMetadata
796
- | ImageURLInputChunk.TextChunkGeneratedMetadata
797
- | ImageURLInputChunk.PdfChunkGeneratedMetadata
798
- | ImageURLInputChunk.CodeChunkGeneratedMetadata
799
- | ImageURLInputChunk.AudioChunkGeneratedMetadata
800
- | ImageURLInputChunk.VideoChunkGeneratedMetadata
801
- | ImageURLInputChunk.ImageChunkGeneratedMetadata
802
- | null;
803
-
804
- /**
805
- * model used for this chunk
806
- */
807
- model?: string | null;
808
-
809
- /**
810
- * Input type identifier
811
- */
812
- type?: 'image_url';
813
-
814
- /**
815
- * ocr text of the image
816
- */
817
- ocr_text?: string | null;
818
-
819
- /**
820
- * summary of the image
821
- */
822
- summary?: string | null;
823
-
824
- /**
825
- * Model for image URL validation.
826
- */
827
- image_url?: ImageURLInputChunk.ImageURL | null;
828
- }
829
-
830
- export namespace ImageURLInputChunk {
831
- export interface MarkdownChunkGeneratedMetadata {
832
- type?: 'markdown';
833
-
834
- file_type?: 'text/markdown';
835
-
836
- language?: string | null;
837
-
838
- word_count?: number | null;
839
-
840
- file_size?: number | null;
841
-
842
- chunk_headings?: Array<MarkdownChunkGeneratedMetadata.ChunkHeading>;
843
-
844
- heading_context?: Array<MarkdownChunkGeneratedMetadata.HeadingContext>;
845
-
846
- start_line?: number;
847
-
848
- num_lines?: number;
849
-
850
- file_extension?: string | null;
851
-
852
- frontmatter?: { [key: string]: unknown };
853
-
854
- [k: string]: unknown;
855
- }
856
-
857
- export namespace MarkdownChunkGeneratedMetadata {
858
- export interface ChunkHeading {
859
- level: number;
860
-
861
- text: string;
862
- }
863
-
864
- export interface HeadingContext {
865
- level: number;
866
-
867
- text: string;
868
- }
869
- }
870
-
871
- export interface TextChunkGeneratedMetadata {
872
- type?: 'text';
873
-
874
- file_type?: 'text/plain';
875
-
876
- language?: string | null;
877
-
878
- word_count?: number | null;
879
-
880
- file_size?: number | null;
881
-
882
- start_line?: number;
883
-
884
- num_lines?: number;
885
-
886
- file_extension?: string | null;
887
-
888
- [k: string]: unknown;
889
- }
890
-
891
- export interface PdfChunkGeneratedMetadata {
892
- type?: 'pdf';
893
-
894
- file_type?: 'application/pdf';
895
-
896
- total_pages?: number | null;
897
-
898
- total_size?: number | null;
899
-
900
- file_extension?: string | null;
901
-
902
- [k: string]: unknown;
903
- }
904
-
905
- export interface CodeChunkGeneratedMetadata {
906
- type?: 'code';
907
-
908
- file_type: string;
909
-
910
- language?: string | null;
911
-
912
- word_count?: number | null;
913
-
914
- file_size?: number | null;
915
-
916
- start_line?: number;
917
-
918
- num_lines?: number;
919
-
920
- file_extension?: string | null;
921
-
922
- [k: string]: unknown;
923
- }
924
-
925
- export interface AudioChunkGeneratedMetadata {
926
- type?: 'audio';
927
-
928
- file_type?: string;
929
-
930
- file_size?: number | null;
931
-
932
- total_duration_seconds?: number | null;
933
-
934
- sample_rate?: number | null;
935
-
936
- channels?: number | null;
937
-
938
- audio_format?: number | null;
939
-
940
- bpm?: number | null;
941
-
942
- file_extension?: string | null;
943
-
944
- [k: string]: unknown;
945
- }
946
-
947
- export interface VideoChunkGeneratedMetadata {
948
- type?: 'video';
949
-
950
- file_type?: string;
951
-
952
- file_size?: number | null;
953
-
954
- total_duration_seconds?: number | null;
955
-
956
- fps?: number | null;
957
-
958
- width?: number | null;
959
-
960
- height?: number | null;
961
-
962
- frame_count?: number | null;
963
-
964
- has_audio_stream?: boolean;
965
-
966
- bpm?: number | null;
967
-
968
- file_extension?: string | null;
969
-
970
- [k: string]: unknown;
971
- }
972
-
973
- export interface ImageChunkGeneratedMetadata {
974
- type?: 'image';
975
-
976
- file_type?: string;
977
-
978
- file_size?: number | null;
979
-
980
- width?: number | null;
981
-
982
- height?: number | null;
983
-
984
- file_extension?: string | null;
985
-
986
- [k: string]: unknown;
987
- }
988
-
989
- /**
990
- * Model for image URL validation.
991
- */
992
- export interface ImageURL {
993
- /**
994
- * The image URL. Can be either a URL or a Data URI.
995
- */
996
- url: string;
997
-
998
- /**
999
- * The image format/mimetype
1000
- */
1001
- format?: string;
1002
- }
1003
- }
1004
-
1005
- export interface AudioURLInputChunk {
1006
- /**
1007
- * position of the chunk in a file
1008
- */
1009
- chunk_index: number;
1010
-
1011
- /**
1012
- * mime type of the chunk
1013
- */
1014
- mime_type?: string;
1015
-
1016
- /**
1017
- * metadata of the chunk
1018
- */
1019
- generated_metadata?:
1020
- | AudioURLInputChunk.MarkdownChunkGeneratedMetadata
1021
- | AudioURLInputChunk.TextChunkGeneratedMetadata
1022
- | AudioURLInputChunk.PdfChunkGeneratedMetadata
1023
- | AudioURLInputChunk.CodeChunkGeneratedMetadata
1024
- | AudioURLInputChunk.AudioChunkGeneratedMetadata
1025
- | AudioURLInputChunk.VideoChunkGeneratedMetadata
1026
- | AudioURLInputChunk.ImageChunkGeneratedMetadata
1027
- | null;
1028
-
1029
- /**
1030
- * model used for this chunk
1031
- */
1032
- model?: string | null;
1033
-
1034
- /**
1035
- * Input type identifier
1036
- */
1037
- type?: 'audio_url';
1038
-
1039
- /**
1040
- * speech recognition (sr) text of the audio
1041
- */
1042
- transcription?: string | null;
1043
-
1044
- /**
1045
- * summary of the audio
1046
- */
1047
- summary?: string | null;
1048
-
1049
- /**
1050
- * Model for audio URL validation.
1051
- */
1052
- audio_url?: AudioURLInputChunk.AudioURL | null;
1053
-
1054
- /**
1055
- * The sampling rate of the audio.
1056
- */
1057
- sampling_rate: number;
1058
- }
1059
-
1060
- export namespace AudioURLInputChunk {
1061
- export interface MarkdownChunkGeneratedMetadata {
1062
- type?: 'markdown';
1063
-
1064
- file_type?: 'text/markdown';
1065
-
1066
- language?: string | null;
1067
-
1068
- word_count?: number | null;
1069
-
1070
- file_size?: number | null;
1071
-
1072
- chunk_headings?: Array<MarkdownChunkGeneratedMetadata.ChunkHeading>;
1073
-
1074
- heading_context?: Array<MarkdownChunkGeneratedMetadata.HeadingContext>;
1075
-
1076
- start_line?: number;
1077
-
1078
- num_lines?: number;
1079
-
1080
- file_extension?: string | null;
1081
-
1082
- frontmatter?: { [key: string]: unknown };
1083
-
1084
- [k: string]: unknown;
1085
- }
1086
-
1087
- export namespace MarkdownChunkGeneratedMetadata {
1088
- export interface ChunkHeading {
1089
- level: number;
1090
-
1091
- text: string;
1092
- }
1093
-
1094
- export interface HeadingContext {
1095
- level: number;
1096
-
1097
- text: string;
1098
- }
1099
- }
1100
-
1101
- export interface TextChunkGeneratedMetadata {
1102
- type?: 'text';
1103
-
1104
- file_type?: 'text/plain';
1105
-
1106
- language?: string | null;
1107
-
1108
- word_count?: number | null;
1109
-
1110
- file_size?: number | null;
1111
-
1112
- start_line?: number;
1113
-
1114
- num_lines?: number;
1115
-
1116
- file_extension?: string | null;
1117
-
1118
- [k: string]: unknown;
1119
- }
1120
-
1121
- export interface PdfChunkGeneratedMetadata {
1122
- type?: 'pdf';
1123
-
1124
- file_type?: 'application/pdf';
1125
-
1126
- total_pages?: number | null;
1127
-
1128
- total_size?: number | null;
1129
-
1130
- file_extension?: string | null;
1131
-
1132
- [k: string]: unknown;
1133
- }
1134
-
1135
- export interface CodeChunkGeneratedMetadata {
1136
- type?: 'code';
1137
-
1138
- file_type: string;
1139
-
1140
- language?: string | null;
1141
-
1142
- word_count?: number | null;
1143
-
1144
- file_size?: number | null;
1145
-
1146
- start_line?: number;
1147
-
1148
- num_lines?: number;
1149
-
1150
- file_extension?: string | null;
1151
-
1152
- [k: string]: unknown;
1153
- }
1154
-
1155
- export interface AudioChunkGeneratedMetadata {
1156
- type?: 'audio';
1157
-
1158
- file_type?: string;
1159
-
1160
- file_size?: number | null;
1161
-
1162
- total_duration_seconds?: number | null;
1163
-
1164
- sample_rate?: number | null;
1165
-
1166
- channels?: number | null;
1167
-
1168
- audio_format?: number | null;
1169
-
1170
- bpm?: number | null;
1171
-
1172
- file_extension?: string | null;
1173
-
1174
- [k: string]: unknown;
1175
- }
1176
-
1177
- export interface VideoChunkGeneratedMetadata {
1178
- type?: 'video';
1179
-
1180
- file_type?: string;
1181
-
1182
- file_size?: number | null;
1183
-
1184
- total_duration_seconds?: number | null;
1185
-
1186
- fps?: number | null;
1187
-
1188
- width?: number | null;
1189
-
1190
- height?: number | null;
1191
-
1192
- frame_count?: number | null;
1193
-
1194
- has_audio_stream?: boolean;
1195
-
1196
- bpm?: number | null;
1197
-
1198
- file_extension?: string | null;
1199
-
1200
- [k: string]: unknown;
1201
- }
1202
-
1203
- export interface ImageChunkGeneratedMetadata {
1204
- type?: 'image';
1205
-
1206
- file_type?: string;
1207
-
1208
- file_size?: number | null;
1209
-
1210
- width?: number | null;
1211
-
1212
- height?: number | null;
1213
-
1214
- file_extension?: string | null;
1215
-
1216
- [k: string]: unknown;
1217
- }
1218
-
1219
- /**
1220
- * Model for audio URL validation.
1221
- */
1222
- export interface AudioURL {
1223
- /**
1224
- * The audio URL. Can be either a URL or a Data URI.
1225
- */
1226
- url: string;
1227
- }
1228
- }
1229
-
1230
- export interface VideoURLInputChunk {
1231
- /**
1232
- * position of the chunk in a file
1233
- */
1234
- chunk_index: number;
1235
-
1236
- /**
1237
- * mime type of the chunk
1238
- */
1239
- mime_type?: string;
1240
-
1241
- /**
1242
- * metadata of the chunk
1243
- */
1244
- generated_metadata?:
1245
- | VideoURLInputChunk.MarkdownChunkGeneratedMetadata
1246
- | VideoURLInputChunk.TextChunkGeneratedMetadata
1247
- | VideoURLInputChunk.PdfChunkGeneratedMetadata
1248
- | VideoURLInputChunk.CodeChunkGeneratedMetadata
1249
- | VideoURLInputChunk.AudioChunkGeneratedMetadata
1250
- | VideoURLInputChunk.VideoChunkGeneratedMetadata
1251
- | VideoURLInputChunk.ImageChunkGeneratedMetadata
1252
- | null;
1253
-
1254
- /**
1255
- * model used for this chunk
1256
- */
1257
- model?: string | null;
1258
-
1259
- /**
1260
- * Input type identifier
1261
- */
1262
- type?: 'video_url';
1263
-
1264
- /**
1265
- * speech recognition (sr) text of the video
1266
- */
1267
- transcription?: string | null;
1268
-
1269
- /**
1270
- * summary of the video
1271
- */
1272
- summary?: 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
- }
1653
-
1654
- export interface FileDeleteParams {
1655
- /**
1656
- * The ID or name of the store
1657
- */
1658
- store_identifier: string;
1659
- }
1660
-
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
- }
871
+ export interface FileDeleteParams {
872
+ /**
873
+ * The ID or name of the store
874
+ */
875
+ store_identifier: string;
876
+ }
1790
877
 
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
  }