@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
@@ -1,6 +1,5 @@
1
1
  import { APIResource } from "../../core/resource.mjs";
2
2
  import * as Shared from "../shared.mjs";
3
- import * as ContentAPI from "../extractions/content.mjs";
4
3
  import * as StoresAPI from "./stores.mjs";
5
4
  import { APIPromise } from "../../core/api-promise.mjs";
6
5
  import { RequestOptions } from "../../internal/request-options.mjs";
@@ -14,6 +13,14 @@ export declare class Files extends APIResource {
14
13
  * to add to the store.
15
14
  *
16
15
  * Returns: VectorStoreFile: The uploaded file details.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * const storeFile = await client.stores.files.create(
20
+ * 'store_identifier',
21
+ * { file_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },
22
+ * );
23
+ * ```
17
24
  */
18
25
  create(storeIdentifier: string, body: FileCreateParams, options?: RequestOptions): APIPromise<StoreFile>;
19
26
  /**
@@ -23,6 +30,14 @@ export declare class Files extends APIResource {
23
30
  * the file. options: Get file options.
24
31
  *
25
32
  * Returns: VectorStoreFile: The file details.
33
+ *
34
+ * @example
35
+ * ```ts
36
+ * const storeFile = await client.stores.files.retrieve(
37
+ * 'file_identifier',
38
+ * { store_identifier: 'store_identifier' },
39
+ * );
40
+ * ```
26
41
  */
27
42
  retrieve(fileIdentifier: string, params: FileRetrieveParams, options?: RequestOptions): APIPromise<StoreFile>;
28
43
  /**
@@ -32,6 +47,14 @@ export declare class Files extends APIResource {
32
47
  * name of the file to update. update_params: Metadata update payload.
33
48
  *
34
49
  * Returns: StoreFile: The updated file details.
50
+ *
51
+ * @example
52
+ * ```ts
53
+ * const storeFile = await client.stores.files.update(
54
+ * 'file_identifier',
55
+ * { store_identifier: 'store_identifier' },
56
+ * );
57
+ * ```
35
58
  */
36
59
  update(fileIdentifier: string, params: FileUpdateParams, options?: RequestOptions): APIPromise<StoreFile>;
37
60
  /**
@@ -41,6 +64,13 @@ export declare class Files extends APIResource {
41
64
  * Pagination parameters and metadata filter
42
65
  *
43
66
  * Returns: VectorStoreFileListResponse: Paginated list of vector store files
67
+ *
68
+ * @example
69
+ * ```ts
70
+ * const files = await client.stores.files.list(
71
+ * 'store_identifier',
72
+ * );
73
+ * ```
44
74
  */
45
75
  list(storeIdentifier: string, body: FileListParams, options?: RequestOptions): APIPromise<FileListResponse>;
46
76
  /**
@@ -50,18 +80,16 @@ export declare class Files extends APIResource {
50
80
  * the file to delete.
51
81
  *
52
82
  * Returns: VectorStoreFileDeleted: The deleted file details.
53
- */
54
- delete(fileIdentifier: string, params: FileDeleteParams, options?: RequestOptions): APIPromise<FileDeleteResponse>;
55
- /**
56
- * Search for files within a store based on semantic similarity.
57
83
  *
58
- * Args: store_identifier: The ID or name of the store to search within
59
- * search_params: Search configuration including query text, pagination, and
60
- * filters
61
- *
62
- * Returns: StoreFileSearchResponse: List of matching files with relevance scores
84
+ * @example
85
+ * ```ts
86
+ * const file = await client.stores.files.delete(
87
+ * 'file_identifier',
88
+ * { store_identifier: 'store_identifier' },
89
+ * );
90
+ * ```
63
91
  */
64
- search(body: FileSearchParams, options?: RequestOptions): APIPromise<FileSearchResponse>;
92
+ delete(fileIdentifier: string, params: FileDeleteParams, options?: RequestOptions): APIPromise<FileDeleteResponse>;
65
93
  /**
66
94
  * Poll for a file's processing status until it reaches a terminal state.
67
95
  *
@@ -173,87 +201,74 @@ export interface FileUploadAndPollHelperParams {
173
201
  returnChunks?: boolean | undefined;
174
202
  multipartUpload?: MultipartUploadConfig | undefined;
175
203
  }
176
- /**
177
- * Represents a scored store file.
178
- */
179
- export interface ScoredStoreFile {
204
+ export interface AudioURLInputChunk {
180
205
  /**
181
- * Unique identifier for the file
206
+ * position of the chunk in a file
182
207
  */
183
- id: string;
208
+ chunk_index: number;
184
209
  /**
185
- * Name of the file
210
+ * mime type of the chunk
186
211
  */
187
- filename?: string;
212
+ mime_type?: string;
188
213
  /**
189
- * Optional file metadata
214
+ * metadata of the chunk
190
215
  */
191
- metadata?: unknown;
216
+ generated_metadata?: StoresAPI.MarkdownChunkGeneratedMetadata | StoresAPI.TextChunkGeneratedMetadata | StoresAPI.PdfChunkGeneratedMetadata | StoresAPI.CodeChunkGeneratedMetadata | StoresAPI.AudioChunkGeneratedMetadata | StoresAPI.VideoChunkGeneratedMetadata | StoresAPI.ImageChunkGeneratedMetadata | null;
192
217
  /**
193
- * External identifier for this file in the store
218
+ * model used for this chunk
194
219
  */
195
- external_id?: string | null;
220
+ model?: string | null;
196
221
  /**
197
- * Processing status of the file
222
+ * Input type identifier
198
223
  */
199
- status?: StoreFileStatus;
224
+ type?: 'audio_url';
200
225
  /**
201
- * Last error message if processing failed
226
+ * speech recognition (sr) text of the audio
202
227
  */
203
- last_error?: unknown;
228
+ transcription?: string | null;
204
229
  /**
205
- * ID of the containing store
230
+ * Model for audio URL validation.
206
231
  */
207
- store_id: string;
232
+ audio_url?: StoresAPI.AudioURL | null;
208
233
  /**
209
- * Timestamp of store file creation
234
+ * The sampling rate of the audio.
210
235
  */
211
- created_at: string;
212
- /**
213
- * Version number of the file
214
- */
215
- version?: number | null;
236
+ sampling_rate: number;
237
+ }
238
+ export interface ImageURLInputChunk {
216
239
  /**
217
- * Storage usage in bytes
240
+ * position of the chunk in a file
218
241
  */
219
- usage_bytes?: number | null;
242
+ chunk_index: number;
220
243
  /**
221
- * Storage usage in tokens
244
+ * mime type of the chunk
222
245
  */
223
- usage_tokens?: number | null;
246
+ mime_type?: string;
224
247
  /**
225
- * Configuration for a file.
248
+ * metadata of the chunk
226
249
  */
227
- config?: ScoredStoreFile.Config | null;
250
+ generated_metadata?: StoresAPI.MarkdownChunkGeneratedMetadata | StoresAPI.TextChunkGeneratedMetadata | StoresAPI.PdfChunkGeneratedMetadata | StoresAPI.CodeChunkGeneratedMetadata | StoresAPI.AudioChunkGeneratedMetadata | StoresAPI.VideoChunkGeneratedMetadata | StoresAPI.ImageChunkGeneratedMetadata | null;
228
251
  /**
229
- * Type of the object
252
+ * model used for this chunk
230
253
  */
231
- object?: 'store.file';
254
+ model?: string | null;
232
255
  /**
233
- * Array of scored file chunks
256
+ * Input type identifier
234
257
  */
235
- chunks: Array<StoresAPI.ScoredTextInputChunk | StoresAPI.ScoredImageURLInputChunk | StoresAPI.ScoredAudioURLInputChunk | StoresAPI.ScoredVideoURLInputChunk> | null;
258
+ type?: 'image_url';
236
259
  /**
237
- * Presigned URL for file content
260
+ * ocr text of the image
238
261
  */
239
- content_url: string;
262
+ ocr_text?: string | null;
240
263
  /**
241
- * score of the file
264
+ * summary of the image
242
265
  */
243
- score: number;
244
- }
245
- export declare namespace ScoredStoreFile {
266
+ summary?: string | null;
246
267
  /**
247
- * Configuration for a file.
268
+ * Model for image URL validation.
248
269
  */
249
- interface Config {
250
- /**
251
- * Strategy for adding the file, this overrides the store-level default
252
- */
253
- parsing_strategy?: 'fast' | 'high_quality';
254
- }
270
+ image_url?: StoresAPI.ImageURLOutput | null;
255
271
  }
256
- export type StoreFileStatus = 'pending' | 'in_progress' | 'cancelled' | 'completed' | 'failed';
257
272
  /**
258
273
  * Represents a file stored in a store.
259
274
  */
@@ -305,7 +320,7 @@ export interface StoreFile {
305
320
  /**
306
321
  * Configuration for a file.
307
322
  */
308
- config?: StoreFile.Config | null;
323
+ config?: StoreFileConfig | null;
309
324
  /**
310
325
  * Type of the object
311
326
  */
@@ -313,553 +328,89 @@ export interface StoreFile {
313
328
  /**
314
329
  * chunks
315
330
  */
316
- chunks?: Array<StoreFile.TextInputChunk | StoreFile.ImageURLInputChunk | StoreFile.AudioURLInputChunk | StoreFile.VideoURLInputChunk> | null;
331
+ chunks?: Array<TextInputChunk | ImageURLInputChunk | AudioURLInputChunk | VideoURLInputChunk> | null;
317
332
  /**
318
333
  * Presigned URL for file content
319
334
  */
320
335
  content_url: string;
321
336
  }
322
- export declare namespace StoreFile {
337
+ /**
338
+ * Configuration for a file.
339
+ */
340
+ export interface StoreFileConfig {
323
341
  /**
324
- * Configuration for a file.
342
+ * Strategy for adding the file, this overrides the store-level default
325
343
  */
326
- interface Config {
327
- /**
328
- * Strategy for adding the file, this overrides the store-level default
329
- */
330
- parsing_strategy?: 'fast' | 'high_quality';
331
- }
332
- interface TextInputChunk {
333
- /**
334
- * position of the chunk in a file
335
- */
336
- chunk_index: number;
337
- /**
338
- * mime type of the chunk
339
- */
340
- mime_type?: string;
341
- /**
342
- * metadata of the chunk
343
- */
344
- generated_metadata?: TextInputChunk.MarkdownChunkGeneratedMetadata | TextInputChunk.TextChunkGeneratedMetadata | TextInputChunk.PdfChunkGeneratedMetadata | TextInputChunk.CodeChunkGeneratedMetadata | TextInputChunk.AudioChunkGeneratedMetadata | TextInputChunk.VideoChunkGeneratedMetadata | TextInputChunk.ImageChunkGeneratedMetadata | null;
345
- /**
346
- * model used for this chunk
347
- */
348
- model?: string | null;
349
- /**
350
- * Input type identifier
351
- */
352
- type?: 'text';
353
- /**
354
- * The offset of the text in the file relative to the start of the file.
355
- */
356
- offset?: number;
357
- /**
358
- * Text content
359
- */
360
- text?: string | null;
361
- }
362
- namespace TextInputChunk {
363
- interface MarkdownChunkGeneratedMetadata {
364
- type?: 'markdown';
365
- file_type?: 'text/markdown';
366
- language?: string | null;
367
- word_count?: number | null;
368
- file_size?: number | null;
369
- chunk_headings?: Array<MarkdownChunkGeneratedMetadata.ChunkHeading>;
370
- heading_context?: Array<MarkdownChunkGeneratedMetadata.HeadingContext>;
371
- start_line?: number;
372
- num_lines?: number;
373
- file_extension?: string | null;
374
- frontmatter?: {
375
- [key: string]: unknown;
376
- };
377
- [k: string]: unknown;
378
- }
379
- namespace MarkdownChunkGeneratedMetadata {
380
- interface ChunkHeading {
381
- level: number;
382
- text: string;
383
- }
384
- interface HeadingContext {
385
- level: number;
386
- text: string;
387
- }
388
- }
389
- interface TextChunkGeneratedMetadata {
390
- type?: 'text';
391
- file_type?: 'text/plain';
392
- language?: string | null;
393
- word_count?: number | null;
394
- file_size?: number | null;
395
- start_line?: number;
396
- num_lines?: number;
397
- file_extension?: string | null;
398
- [k: string]: unknown;
399
- }
400
- interface PdfChunkGeneratedMetadata {
401
- type?: 'pdf';
402
- file_type?: 'application/pdf';
403
- total_pages?: number | null;
404
- total_size?: number | null;
405
- file_extension?: string | null;
406
- [k: string]: unknown;
407
- }
408
- interface CodeChunkGeneratedMetadata {
409
- type?: 'code';
410
- file_type: string;
411
- language?: string | null;
412
- word_count?: number | null;
413
- file_size?: number | null;
414
- start_line?: number;
415
- num_lines?: number;
416
- file_extension?: string | null;
417
- [k: string]: unknown;
418
- }
419
- interface AudioChunkGeneratedMetadata {
420
- type?: 'audio';
421
- file_type?: string;
422
- file_size?: number | null;
423
- total_duration_seconds?: number | null;
424
- sample_rate?: number | null;
425
- channels?: number | null;
426
- audio_format?: number | null;
427
- bpm?: number | null;
428
- file_extension?: string | null;
429
- [k: string]: unknown;
430
- }
431
- interface VideoChunkGeneratedMetadata {
432
- type?: 'video';
433
- file_type?: string;
434
- file_size?: number | null;
435
- total_duration_seconds?: number | null;
436
- fps?: number | null;
437
- width?: number | null;
438
- height?: number | null;
439
- frame_count?: number | null;
440
- has_audio_stream?: boolean;
441
- bpm?: number | null;
442
- file_extension?: string | null;
443
- [k: string]: unknown;
444
- }
445
- interface ImageChunkGeneratedMetadata {
446
- type?: 'image';
447
- file_type?: string;
448
- file_size?: number | null;
449
- width?: number | null;
450
- height?: number | null;
451
- file_extension?: string | null;
452
- [k: string]: unknown;
453
- }
454
- }
455
- interface ImageURLInputChunk {
456
- /**
457
- * position of the chunk in a file
458
- */
459
- chunk_index: number;
460
- /**
461
- * mime type of the chunk
462
- */
463
- mime_type?: string;
464
- /**
465
- * metadata of the chunk
466
- */
467
- generated_metadata?: ImageURLInputChunk.MarkdownChunkGeneratedMetadata | ImageURLInputChunk.TextChunkGeneratedMetadata | ImageURLInputChunk.PdfChunkGeneratedMetadata | ImageURLInputChunk.CodeChunkGeneratedMetadata | ImageURLInputChunk.AudioChunkGeneratedMetadata | ImageURLInputChunk.VideoChunkGeneratedMetadata | ImageURLInputChunk.ImageChunkGeneratedMetadata | null;
468
- /**
469
- * model used for this chunk
470
- */
471
- model?: string | null;
472
- /**
473
- * Input type identifier
474
- */
475
- type?: 'image_url';
476
- /**
477
- * ocr text of the image
478
- */
479
- ocr_text?: string | null;
480
- /**
481
- * summary of the image
482
- */
483
- summary?: string | null;
484
- /**
485
- * Model for image URL validation.
486
- */
487
- image_url?: ImageURLInputChunk.ImageURL | null;
488
- }
489
- namespace ImageURLInputChunk {
490
- interface MarkdownChunkGeneratedMetadata {
491
- type?: 'markdown';
492
- file_type?: 'text/markdown';
493
- language?: string | null;
494
- word_count?: number | null;
495
- file_size?: number | null;
496
- chunk_headings?: Array<MarkdownChunkGeneratedMetadata.ChunkHeading>;
497
- heading_context?: Array<MarkdownChunkGeneratedMetadata.HeadingContext>;
498
- start_line?: number;
499
- num_lines?: number;
500
- file_extension?: string | null;
501
- frontmatter?: {
502
- [key: string]: unknown;
503
- };
504
- [k: string]: unknown;
505
- }
506
- namespace MarkdownChunkGeneratedMetadata {
507
- interface ChunkHeading {
508
- level: number;
509
- text: string;
510
- }
511
- interface HeadingContext {
512
- level: number;
513
- text: string;
514
- }
515
- }
516
- interface TextChunkGeneratedMetadata {
517
- type?: 'text';
518
- file_type?: 'text/plain';
519
- language?: string | null;
520
- word_count?: number | null;
521
- file_size?: number | null;
522
- start_line?: number;
523
- num_lines?: number;
524
- file_extension?: string | null;
525
- [k: string]: unknown;
526
- }
527
- interface PdfChunkGeneratedMetadata {
528
- type?: 'pdf';
529
- file_type?: 'application/pdf';
530
- total_pages?: number | null;
531
- total_size?: number | null;
532
- file_extension?: string | null;
533
- [k: string]: unknown;
534
- }
535
- interface CodeChunkGeneratedMetadata {
536
- type?: 'code';
537
- file_type: string;
538
- language?: string | null;
539
- word_count?: number | null;
540
- file_size?: number | null;
541
- start_line?: number;
542
- num_lines?: number;
543
- file_extension?: string | null;
544
- [k: string]: unknown;
545
- }
546
- interface AudioChunkGeneratedMetadata {
547
- type?: 'audio';
548
- file_type?: string;
549
- file_size?: number | null;
550
- total_duration_seconds?: number | null;
551
- sample_rate?: number | null;
552
- channels?: number | null;
553
- audio_format?: number | null;
554
- bpm?: number | null;
555
- file_extension?: string | null;
556
- [k: string]: unknown;
557
- }
558
- interface VideoChunkGeneratedMetadata {
559
- type?: 'video';
560
- file_type?: string;
561
- file_size?: number | null;
562
- total_duration_seconds?: number | null;
563
- fps?: number | null;
564
- width?: number | null;
565
- height?: number | null;
566
- frame_count?: number | null;
567
- has_audio_stream?: boolean;
568
- bpm?: number | null;
569
- file_extension?: string | null;
570
- [k: string]: unknown;
571
- }
572
- interface ImageChunkGeneratedMetadata {
573
- type?: 'image';
574
- file_type?: string;
575
- file_size?: number | null;
576
- width?: number | null;
577
- height?: number | null;
578
- file_extension?: string | null;
579
- [k: string]: unknown;
580
- }
581
- /**
582
- * Model for image URL validation.
583
- */
584
- interface ImageURL {
585
- /**
586
- * The image URL. Can be either a URL or a Data URI.
587
- */
588
- url: string;
589
- /**
590
- * The image format/mimetype
591
- */
592
- format?: string;
593
- }
594
- }
595
- interface AudioURLInputChunk {
596
- /**
597
- * position of the chunk in a file
598
- */
599
- chunk_index: number;
600
- /**
601
- * mime type of the chunk
602
- */
603
- mime_type?: string;
604
- /**
605
- * metadata of the chunk
606
- */
607
- generated_metadata?: AudioURLInputChunk.MarkdownChunkGeneratedMetadata | AudioURLInputChunk.TextChunkGeneratedMetadata | AudioURLInputChunk.PdfChunkGeneratedMetadata | AudioURLInputChunk.CodeChunkGeneratedMetadata | AudioURLInputChunk.AudioChunkGeneratedMetadata | AudioURLInputChunk.VideoChunkGeneratedMetadata | AudioURLInputChunk.ImageChunkGeneratedMetadata | null;
608
- /**
609
- * model used for this chunk
610
- */
611
- model?: string | null;
612
- /**
613
- * Input type identifier
614
- */
615
- type?: 'audio_url';
616
- /**
617
- * speech recognition (sr) text of the audio
618
- */
619
- transcription?: string | null;
620
- /**
621
- * Model for audio URL validation.
622
- */
623
- audio_url?: AudioURLInputChunk.AudioURL | null;
624
- /**
625
- * The sampling rate of the audio.
626
- */
627
- sampling_rate: number;
628
- }
629
- namespace AudioURLInputChunk {
630
- interface MarkdownChunkGeneratedMetadata {
631
- type?: 'markdown';
632
- file_type?: 'text/markdown';
633
- language?: string | null;
634
- word_count?: number | null;
635
- file_size?: number | null;
636
- chunk_headings?: Array<MarkdownChunkGeneratedMetadata.ChunkHeading>;
637
- heading_context?: Array<MarkdownChunkGeneratedMetadata.HeadingContext>;
638
- start_line?: number;
639
- num_lines?: number;
640
- file_extension?: string | null;
641
- frontmatter?: {
642
- [key: string]: unknown;
643
- };
644
- [k: string]: unknown;
645
- }
646
- namespace MarkdownChunkGeneratedMetadata {
647
- interface ChunkHeading {
648
- level: number;
649
- text: string;
650
- }
651
- interface HeadingContext {
652
- level: number;
653
- text: string;
654
- }
655
- }
656
- interface TextChunkGeneratedMetadata {
657
- type?: 'text';
658
- file_type?: 'text/plain';
659
- language?: string | null;
660
- word_count?: number | null;
661
- file_size?: number | null;
662
- start_line?: number;
663
- num_lines?: number;
664
- file_extension?: string | null;
665
- [k: string]: unknown;
666
- }
667
- interface PdfChunkGeneratedMetadata {
668
- type?: 'pdf';
669
- file_type?: 'application/pdf';
670
- total_pages?: number | null;
671
- total_size?: number | null;
672
- file_extension?: string | null;
673
- [k: string]: unknown;
674
- }
675
- interface CodeChunkGeneratedMetadata {
676
- type?: 'code';
677
- file_type: string;
678
- language?: string | null;
679
- word_count?: number | null;
680
- file_size?: number | null;
681
- start_line?: number;
682
- num_lines?: number;
683
- file_extension?: string | null;
684
- [k: string]: unknown;
685
- }
686
- interface AudioChunkGeneratedMetadata {
687
- type?: 'audio';
688
- file_type?: string;
689
- file_size?: number | null;
690
- total_duration_seconds?: number | null;
691
- sample_rate?: number | null;
692
- channels?: number | null;
693
- audio_format?: number | null;
694
- bpm?: number | null;
695
- file_extension?: string | null;
696
- [k: string]: unknown;
697
- }
698
- interface VideoChunkGeneratedMetadata {
699
- type?: 'video';
700
- file_type?: string;
701
- file_size?: number | null;
702
- total_duration_seconds?: number | null;
703
- fps?: number | null;
704
- width?: number | null;
705
- height?: number | null;
706
- frame_count?: number | null;
707
- has_audio_stream?: boolean;
708
- bpm?: number | null;
709
- file_extension?: string | null;
710
- [k: string]: unknown;
711
- }
712
- interface ImageChunkGeneratedMetadata {
713
- type?: 'image';
714
- file_type?: string;
715
- file_size?: number | null;
716
- width?: number | null;
717
- height?: number | null;
718
- file_extension?: string | null;
719
- [k: string]: unknown;
720
- }
721
- /**
722
- * Model for audio URL validation.
723
- */
724
- interface AudioURL {
725
- /**
726
- * The audio URL. Can be either a URL or a Data URI.
727
- */
728
- url: string;
729
- }
730
- }
731
- interface VideoURLInputChunk {
732
- /**
733
- * position of the chunk in a file
734
- */
735
- chunk_index: number;
736
- /**
737
- * mime type of the chunk
738
- */
739
- mime_type?: string;
740
- /**
741
- * metadata of the chunk
742
- */
743
- generated_metadata?: VideoURLInputChunk.MarkdownChunkGeneratedMetadata | VideoURLInputChunk.TextChunkGeneratedMetadata | VideoURLInputChunk.PdfChunkGeneratedMetadata | VideoURLInputChunk.CodeChunkGeneratedMetadata | VideoURLInputChunk.AudioChunkGeneratedMetadata | VideoURLInputChunk.VideoChunkGeneratedMetadata | VideoURLInputChunk.ImageChunkGeneratedMetadata | null;
744
- /**
745
- * model used for this chunk
746
- */
747
- model?: string | null;
748
- /**
749
- * Input type identifier
750
- */
751
- type?: 'video_url';
752
- /**
753
- * speech recognition (sr) text of the video
754
- */
755
- transcription?: string | null;
756
- /**
757
- * Model for video URL validation.
758
- */
759
- video_url?: VideoURLInputChunk.VideoURL | null;
760
- }
761
- namespace VideoURLInputChunk {
762
- interface MarkdownChunkGeneratedMetadata {
763
- type?: 'markdown';
764
- file_type?: 'text/markdown';
765
- language?: string | null;
766
- word_count?: number | null;
767
- file_size?: number | null;
768
- chunk_headings?: Array<MarkdownChunkGeneratedMetadata.ChunkHeading>;
769
- heading_context?: Array<MarkdownChunkGeneratedMetadata.HeadingContext>;
770
- start_line?: number;
771
- num_lines?: number;
772
- file_extension?: string | null;
773
- frontmatter?: {
774
- [key: string]: unknown;
775
- };
776
- [k: string]: unknown;
777
- }
778
- namespace MarkdownChunkGeneratedMetadata {
779
- interface ChunkHeading {
780
- level: number;
781
- text: string;
782
- }
783
- interface HeadingContext {
784
- level: number;
785
- text: string;
786
- }
787
- }
788
- interface TextChunkGeneratedMetadata {
789
- type?: 'text';
790
- file_type?: 'text/plain';
791
- language?: string | null;
792
- word_count?: number | null;
793
- file_size?: number | null;
794
- start_line?: number;
795
- num_lines?: number;
796
- file_extension?: string | null;
797
- [k: string]: unknown;
798
- }
799
- interface PdfChunkGeneratedMetadata {
800
- type?: 'pdf';
801
- file_type?: 'application/pdf';
802
- total_pages?: number | null;
803
- total_size?: number | null;
804
- file_extension?: string | null;
805
- [k: string]: unknown;
806
- }
807
- interface CodeChunkGeneratedMetadata {
808
- type?: 'code';
809
- file_type: string;
810
- language?: string | null;
811
- word_count?: number | null;
812
- file_size?: number | null;
813
- start_line?: number;
814
- num_lines?: number;
815
- file_extension?: string | null;
816
- [k: string]: unknown;
817
- }
818
- interface AudioChunkGeneratedMetadata {
819
- type?: 'audio';
820
- file_type?: string;
821
- file_size?: number | null;
822
- total_duration_seconds?: number | null;
823
- sample_rate?: number | null;
824
- channels?: number | null;
825
- audio_format?: number | null;
826
- bpm?: number | null;
827
- file_extension?: string | null;
828
- [k: string]: unknown;
829
- }
830
- interface VideoChunkGeneratedMetadata {
831
- type?: 'video';
832
- file_type?: string;
833
- file_size?: number | null;
834
- total_duration_seconds?: number | null;
835
- fps?: number | null;
836
- width?: number | null;
837
- height?: number | null;
838
- frame_count?: number | null;
839
- has_audio_stream?: boolean;
840
- bpm?: number | null;
841
- file_extension?: string | null;
842
- [k: string]: unknown;
843
- }
844
- interface ImageChunkGeneratedMetadata {
845
- type?: 'image';
846
- file_type?: string;
847
- file_size?: number | null;
848
- width?: number | null;
849
- height?: number | null;
850
- file_extension?: string | null;
851
- [k: string]: unknown;
852
- }
853
- /**
854
- * Model for video URL validation.
855
- */
856
- interface VideoURL {
857
- /**
858
- * The video URL. Can be either a URL or a Data URI.
859
- */
860
- url: string;
861
- }
862
- }
344
+ parsing_strategy?: 'fast' | 'high_quality';
345
+ }
346
+ export type StoreFileStatus = 'pending' | 'in_progress' | 'cancelled' | 'completed' | 'failed';
347
+ export interface TextInputChunk {
348
+ /**
349
+ * position of the chunk in a file
350
+ */
351
+ chunk_index: number;
352
+ /**
353
+ * mime type of the chunk
354
+ */
355
+ mime_type?: string;
356
+ /**
357
+ * metadata of the chunk
358
+ */
359
+ generated_metadata?: StoresAPI.MarkdownChunkGeneratedMetadata | StoresAPI.TextChunkGeneratedMetadata | StoresAPI.PdfChunkGeneratedMetadata | StoresAPI.CodeChunkGeneratedMetadata | StoresAPI.AudioChunkGeneratedMetadata | StoresAPI.VideoChunkGeneratedMetadata | StoresAPI.ImageChunkGeneratedMetadata | null;
360
+ /**
361
+ * model used for this chunk
362
+ */
363
+ model?: string | null;
364
+ /**
365
+ * Input type identifier
366
+ */
367
+ type?: 'text';
368
+ /**
369
+ * The offset of the text in the file relative to the start of the file.
370
+ */
371
+ offset?: number;
372
+ /**
373
+ * Text content
374
+ */
375
+ text?: string | null;
376
+ /**
377
+ * LLM-generated context that situates this chunk within its source document
378
+ */
379
+ context?: string | null;
380
+ }
381
+ export interface VideoURLInputChunk {
382
+ /**
383
+ * position of the chunk in a file
384
+ */
385
+ chunk_index: number;
386
+ /**
387
+ * mime type of the chunk
388
+ */
389
+ mime_type?: string;
390
+ /**
391
+ * metadata of the chunk
392
+ */
393
+ generated_metadata?: StoresAPI.MarkdownChunkGeneratedMetadata | StoresAPI.TextChunkGeneratedMetadata | StoresAPI.PdfChunkGeneratedMetadata | StoresAPI.CodeChunkGeneratedMetadata | StoresAPI.AudioChunkGeneratedMetadata | StoresAPI.VideoChunkGeneratedMetadata | StoresAPI.ImageChunkGeneratedMetadata | null;
394
+ /**
395
+ * model used for this chunk
396
+ */
397
+ model?: string | null;
398
+ /**
399
+ * Input type identifier
400
+ */
401
+ type?: 'video_url';
402
+ /**
403
+ * speech recognition (sr) text of the video
404
+ */
405
+ transcription?: string | null;
406
+ /**
407
+ * summary of the video
408
+ */
409
+ summary?: string | null;
410
+ /**
411
+ * Model for video URL validation.
412
+ */
413
+ video_url?: StoresAPI.VideoURL | null;
863
414
  }
864
415
  export interface FileListResponse {
865
416
  /**
@@ -920,16 +471,6 @@ export interface FileDeleteResponse {
920
471
  */
921
472
  object?: 'store.file';
922
473
  }
923
- export interface FileSearchResponse {
924
- /**
925
- * The object type of the response
926
- */
927
- object?: 'list';
928
- /**
929
- * The list of scored store files
930
- */
931
- data: Array<ScoredStoreFile>;
932
- }
933
474
  export interface FileCreateParams {
934
475
  /**
935
476
  * Optional metadata for the file
@@ -938,7 +479,7 @@ export interface FileCreateParams {
938
479
  /**
939
480
  * Configuration for adding the file
940
481
  */
941
- config?: FileCreateParams.Config;
482
+ config?: StoreFileConfig;
942
483
  /**
943
484
  * External identifier for this file in the store
944
485
  */
@@ -952,29 +493,9 @@ export interface FileCreateParams {
952
493
  */
953
494
  file_id: string;
954
495
  /**
955
- * @deprecated Configuration for a file.
956
- */
957
- experimental?: FileCreateParams.Experimental | null;
958
- }
959
- export declare namespace FileCreateParams {
960
- /**
961
- * Configuration for adding the file
962
- */
963
- interface Config {
964
- /**
965
- * Strategy for adding the file, this overrides the store-level default
966
- */
967
- parsing_strategy?: 'fast' | 'high_quality';
968
- }
969
- /**
970
- * @deprecated Configuration for a file.
496
+ * Configuration for a file.
971
497
  */
972
- interface Experimental {
973
- /**
974
- * Strategy for adding the file, this overrides the store-level default
975
- */
976
- parsing_strategy?: 'fast' | 'high_quality';
977
- }
498
+ experimental?: StoreFileConfig | null;
978
499
  }
979
500
  export interface FileRetrieveParams {
980
501
  /**
@@ -1037,113 +558,7 @@ export interface FileDeleteParams {
1037
558
  */
1038
559
  store_identifier: string;
1039
560
  }
1040
- export interface FileSearchParams {
1041
- /**
1042
- * Search query text
1043
- */
1044
- query: string | ContentAPI.ImageURLInput | ContentAPI.TextInput;
1045
- /**
1046
- * IDs or names of stores to search
1047
- */
1048
- store_identifiers: Array<string>;
1049
- /**
1050
- * Number of results to return
1051
- */
1052
- top_k?: number;
1053
- /**
1054
- * Optional filter conditions
1055
- */
1056
- filters?: Shared.SearchFilter | Shared.SearchFilterCondition | Array<Shared.SearchFilter | Shared.SearchFilterCondition> | null;
1057
- /**
1058
- * Optional list of file IDs to filter chunks by (inclusion filter)
1059
- */
1060
- file_ids?: Array<unknown> | Array<string> | null;
1061
- /**
1062
- * Search configuration options
1063
- */
1064
- search_options?: FileSearchParams.SearchOptions;
1065
- }
1066
- export declare namespace FileSearchParams {
1067
- /**
1068
- * Search configuration options
1069
- */
1070
- interface SearchOptions {
1071
- /**
1072
- * Minimum similarity score threshold
1073
- */
1074
- score_threshold?: number;
1075
- /**
1076
- * Whether to rewrite the query. Ignored when agentic is enabled (the agent handles
1077
- * query decomposition).
1078
- */
1079
- rewrite_query?: boolean;
1080
- /**
1081
- * Whether to rerank results and optional reranking configuration. Ignored when
1082
- * agentic is enabled (the agent handles ranking).
1083
- */
1084
- rerank?: boolean | SearchOptions.RerankConfig | null;
1085
- /**
1086
- * Whether to use agentic multi-query search with automatic query decomposition and
1087
- * ranking. When enabled, rewrite_query and rerank options are ignored.
1088
- */
1089
- agentic?: boolean | SearchOptions.AgenticSearchConfig | null;
1090
- /**
1091
- * Whether to return file metadata
1092
- */
1093
- return_metadata?: boolean;
1094
- /**
1095
- * Whether to return matching text chunks
1096
- */
1097
- return_chunks?: boolean;
1098
- /**
1099
- * Number of chunks to return for each file
1100
- */
1101
- chunks_per_file?: number;
1102
- /**
1103
- * Whether to apply search rules
1104
- */
1105
- apply_search_rules?: boolean;
1106
- }
1107
- namespace SearchOptions {
1108
- /**
1109
- * Represents a reranking configuration.
1110
- */
1111
- interface RerankConfig {
1112
- /**
1113
- * The name of the reranking model
1114
- */
1115
- model?: string;
1116
- /**
1117
- * Whether to include metadata in the reranked results
1118
- */
1119
- with_metadata?: boolean | Array<string>;
1120
- /**
1121
- * Maximum number of results to return after reranking. If None, returns all
1122
- * reranked results.
1123
- */
1124
- top_k?: number | null;
1125
- }
1126
- /**
1127
- * Configuration for agentic multi-query search.
1128
- */
1129
- interface AgenticSearchConfig {
1130
- /**
1131
- * Maximum number of search rounds
1132
- */
1133
- max_rounds?: number;
1134
- /**
1135
- * Maximum queries per round
1136
- */
1137
- queries_per_round?: number;
1138
- /**
1139
- * Additional custom instructions (followed only when not in conflict with existing
1140
- * rules)
1141
- */
1142
- instructions?: string | null;
1143
- }
1144
- }
1145
- }
1146
561
  export declare namespace Files {
1147
- export { type ScoredStoreFile as ScoredStoreFile, type StoreFileStatus as StoreFileStatus, type StoreFile as StoreFile, type FileListResponse as FileListResponse, type FileDeleteResponse as FileDeleteResponse, type FileSearchResponse as FileSearchResponse, type FileCreateParams as FileCreateParams, type FileRetrieveParams as FileRetrieveParams, type FileUpdateParams as FileUpdateParams, type FileListParams as FileListParams, type FileDeleteParams as FileDeleteParams, type FileSearchParams as FileSearchParams, };
562
+ export { type AudioURLInputChunk as AudioURLInputChunk, type ImageURLInputChunk as ImageURLInputChunk, type StoreFile as StoreFile, type StoreFileConfig as StoreFileConfig, type StoreFileStatus as StoreFileStatus, type TextInputChunk as TextInputChunk, type VideoURLInputChunk as VideoURLInputChunk, type FileListResponse as FileListResponse, type FileDeleteResponse as FileDeleteResponse, type FileCreateParams as FileCreateParams, type FileRetrieveParams as FileRetrieveParams, type FileUpdateParams as FileUpdateParams, type FileListParams as FileListParams, type FileDeleteParams as FileDeleteParams, };
1148
563
  }
1149
564
  //# sourceMappingURL=files.d.mts.map