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