@mixedbread/sdk 0.50.1 → 0.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -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 +11 -6
- package/client.js.map +1 -1
- package/client.mjs +11 -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 +94 -20
- package/resources/stores/files.d.mts.map +1 -1
- package/resources/stores/files.d.ts +94 -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 +599 -10
- package/resources/stores/stores.d.mts.map +1 -1
- package/resources/stores/stores.d.ts +599 -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 +23 -42
- package/src/internal/parse.ts +6 -0
- package/src/resources/index.ts +5 -19
- package/src/resources/stores/files.ts +132 -19
- package/src/resources/stores/index.ts +5 -0
- package/src/resources/stores/stores.ts +898 -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
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { APIResource } from "../../core/resource.js";
|
|
2
2
|
import * as Shared from "../shared.js";
|
|
3
|
+
import * as ContentAPI from "../extractions/content.js";
|
|
3
4
|
import * as FilesAPI from "./files.js";
|
|
4
5
|
import { FileCreateParams, FileDeleteParams, FileDeleteResponse, FileListParams, FileListResponse, FileRetrieveParams, FileSearchParams, FileSearchResponse, FileUpdateParams, Files, ScoredStoreFile, StoreFile, StoreFileStatus } from "./files.js";
|
|
5
|
-
import * as VectorStoresFilesAPI from "../vector-stores/files.js";
|
|
6
|
-
import * as VectorStoresAPI from "../vector-stores/vector-stores.js";
|
|
7
6
|
import { APIPromise } from "../../core/api-promise.js";
|
|
8
7
|
import { Cursor, type CursorParams, PagePromise } from "../../core/pagination.js";
|
|
9
8
|
import { RequestOptions } from "../../internal/request-options.js";
|
|
@@ -86,6 +85,566 @@ export declare class Stores extends APIResource {
|
|
|
86
85
|
search(body: StoreSearchParams, options?: RequestOptions): APIPromise<StoreSearchResponse>;
|
|
87
86
|
}
|
|
88
87
|
export type StoresCursor = Cursor<Store>;
|
|
88
|
+
/**
|
|
89
|
+
* Represents an expiration policy for a store.
|
|
90
|
+
*/
|
|
91
|
+
export interface ExpiresAfter {
|
|
92
|
+
/**
|
|
93
|
+
* Anchor date for the expiration policy
|
|
94
|
+
*/
|
|
95
|
+
anchor?: 'last_active_at';
|
|
96
|
+
/**
|
|
97
|
+
* Number of days after which the store expires
|
|
98
|
+
*/
|
|
99
|
+
days?: number;
|
|
100
|
+
}
|
|
101
|
+
export interface ScoredAudioURLInputChunk {
|
|
102
|
+
/**
|
|
103
|
+
* position of the chunk in a file
|
|
104
|
+
*/
|
|
105
|
+
chunk_index: number;
|
|
106
|
+
/**
|
|
107
|
+
* mime type of the chunk
|
|
108
|
+
*/
|
|
109
|
+
mime_type?: string;
|
|
110
|
+
/**
|
|
111
|
+
* metadata of the chunk
|
|
112
|
+
*/
|
|
113
|
+
generated_metadata?: ScoredAudioURLInputChunk.MarkdownChunkGeneratedMetadata | ScoredAudioURLInputChunk.TextChunkGeneratedMetadata | ScoredAudioURLInputChunk.PdfChunkGeneratedMetadata | ScoredAudioURLInputChunk.CodeChunkGeneratedMetadata | ScoredAudioURLInputChunk.AudioChunkGeneratedMetadata | ScoredAudioURLInputChunk.VideoChunkGeneratedMetadata | null;
|
|
114
|
+
/**
|
|
115
|
+
* model used for this chunk
|
|
116
|
+
*/
|
|
117
|
+
model?: string | null;
|
|
118
|
+
/**
|
|
119
|
+
* score of the chunk
|
|
120
|
+
*/
|
|
121
|
+
score: number;
|
|
122
|
+
/**
|
|
123
|
+
* file id
|
|
124
|
+
*/
|
|
125
|
+
file_id: string;
|
|
126
|
+
/**
|
|
127
|
+
* filename
|
|
128
|
+
*/
|
|
129
|
+
filename: string;
|
|
130
|
+
/**
|
|
131
|
+
* store id
|
|
132
|
+
*/
|
|
133
|
+
store_id: string;
|
|
134
|
+
/**
|
|
135
|
+
* file metadata
|
|
136
|
+
*/
|
|
137
|
+
metadata?: unknown;
|
|
138
|
+
/**
|
|
139
|
+
* Input type identifier
|
|
140
|
+
*/
|
|
141
|
+
type?: 'audio_url';
|
|
142
|
+
/**
|
|
143
|
+
* speech recognition (sr) text of the audio
|
|
144
|
+
*/
|
|
145
|
+
transcription?: string | null;
|
|
146
|
+
/**
|
|
147
|
+
* summary of the audio
|
|
148
|
+
*/
|
|
149
|
+
summary?: string | null;
|
|
150
|
+
/**
|
|
151
|
+
* Model for audio URL validation.
|
|
152
|
+
*/
|
|
153
|
+
audio_url?: ScoredAudioURLInputChunk.AudioURL | null;
|
|
154
|
+
/**
|
|
155
|
+
* The sampling rate of the audio.
|
|
156
|
+
*/
|
|
157
|
+
sampling_rate: number;
|
|
158
|
+
}
|
|
159
|
+
export declare namespace ScoredAudioURLInputChunk {
|
|
160
|
+
interface MarkdownChunkGeneratedMetadata {
|
|
161
|
+
type?: 'markdown';
|
|
162
|
+
file_type?: 'text/markdown';
|
|
163
|
+
language: string;
|
|
164
|
+
word_count: number;
|
|
165
|
+
file_size: number;
|
|
166
|
+
chunk_headings?: Array<MarkdownChunkGeneratedMetadata.ChunkHeading>;
|
|
167
|
+
heading_context?: Array<MarkdownChunkGeneratedMetadata.HeadingContext>;
|
|
168
|
+
start_line?: number;
|
|
169
|
+
num_lines?: number;
|
|
170
|
+
frontmatter?: {
|
|
171
|
+
[key: string]: unknown;
|
|
172
|
+
};
|
|
173
|
+
[k: string]: unknown;
|
|
174
|
+
}
|
|
175
|
+
namespace MarkdownChunkGeneratedMetadata {
|
|
176
|
+
interface ChunkHeading {
|
|
177
|
+
level: number;
|
|
178
|
+
text: string;
|
|
179
|
+
}
|
|
180
|
+
interface HeadingContext {
|
|
181
|
+
level: number;
|
|
182
|
+
text: string;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
interface TextChunkGeneratedMetadata {
|
|
186
|
+
type?: 'text';
|
|
187
|
+
file_type?: 'text/plain';
|
|
188
|
+
language: string;
|
|
189
|
+
word_count: number;
|
|
190
|
+
file_size: number;
|
|
191
|
+
start_line?: number;
|
|
192
|
+
num_lines?: number;
|
|
193
|
+
[k: string]: unknown;
|
|
194
|
+
}
|
|
195
|
+
interface PdfChunkGeneratedMetadata {
|
|
196
|
+
type?: 'pdf';
|
|
197
|
+
file_type?: 'application/pdf';
|
|
198
|
+
total_pages: number;
|
|
199
|
+
total_size: number;
|
|
200
|
+
[k: string]: unknown;
|
|
201
|
+
}
|
|
202
|
+
interface CodeChunkGeneratedMetadata {
|
|
203
|
+
type?: 'code';
|
|
204
|
+
file_type: string;
|
|
205
|
+
language: string;
|
|
206
|
+
word_count: number;
|
|
207
|
+
file_size: number;
|
|
208
|
+
start_line?: number;
|
|
209
|
+
num_lines?: number;
|
|
210
|
+
[k: string]: unknown;
|
|
211
|
+
}
|
|
212
|
+
interface AudioChunkGeneratedMetadata {
|
|
213
|
+
type?: 'audio';
|
|
214
|
+
file_type: string;
|
|
215
|
+
file_size: number;
|
|
216
|
+
total_duration_seconds: number;
|
|
217
|
+
sample_rate: number;
|
|
218
|
+
channels: number;
|
|
219
|
+
audio_format: number;
|
|
220
|
+
[k: string]: unknown;
|
|
221
|
+
}
|
|
222
|
+
interface VideoChunkGeneratedMetadata {
|
|
223
|
+
type?: 'video';
|
|
224
|
+
file_type: string;
|
|
225
|
+
file_size: number;
|
|
226
|
+
total_duration_seconds: number;
|
|
227
|
+
fps: number;
|
|
228
|
+
width: number;
|
|
229
|
+
height: number;
|
|
230
|
+
frame_count: number;
|
|
231
|
+
[k: string]: unknown;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Model for audio URL validation.
|
|
235
|
+
*/
|
|
236
|
+
interface AudioURL {
|
|
237
|
+
/**
|
|
238
|
+
* The audio URL. Can be either a URL or a Data URI.
|
|
239
|
+
*/
|
|
240
|
+
url: string;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
export interface ScoredImageURLInputChunk {
|
|
244
|
+
/**
|
|
245
|
+
* position of the chunk in a file
|
|
246
|
+
*/
|
|
247
|
+
chunk_index: number;
|
|
248
|
+
/**
|
|
249
|
+
* mime type of the chunk
|
|
250
|
+
*/
|
|
251
|
+
mime_type?: string;
|
|
252
|
+
/**
|
|
253
|
+
* metadata of the chunk
|
|
254
|
+
*/
|
|
255
|
+
generated_metadata?: ScoredImageURLInputChunk.MarkdownChunkGeneratedMetadata | ScoredImageURLInputChunk.TextChunkGeneratedMetadata | ScoredImageURLInputChunk.PdfChunkGeneratedMetadata | ScoredImageURLInputChunk.CodeChunkGeneratedMetadata | ScoredImageURLInputChunk.AudioChunkGeneratedMetadata | ScoredImageURLInputChunk.VideoChunkGeneratedMetadata | null;
|
|
256
|
+
/**
|
|
257
|
+
* model used for this chunk
|
|
258
|
+
*/
|
|
259
|
+
model?: string | null;
|
|
260
|
+
/**
|
|
261
|
+
* score of the chunk
|
|
262
|
+
*/
|
|
263
|
+
score: number;
|
|
264
|
+
/**
|
|
265
|
+
* file id
|
|
266
|
+
*/
|
|
267
|
+
file_id: string;
|
|
268
|
+
/**
|
|
269
|
+
* filename
|
|
270
|
+
*/
|
|
271
|
+
filename: string;
|
|
272
|
+
/**
|
|
273
|
+
* store id
|
|
274
|
+
*/
|
|
275
|
+
store_id: string;
|
|
276
|
+
/**
|
|
277
|
+
* file metadata
|
|
278
|
+
*/
|
|
279
|
+
metadata?: unknown;
|
|
280
|
+
/**
|
|
281
|
+
* Input type identifier
|
|
282
|
+
*/
|
|
283
|
+
type?: 'image_url';
|
|
284
|
+
/**
|
|
285
|
+
* ocr text of the image
|
|
286
|
+
*/
|
|
287
|
+
ocr_text?: string | null;
|
|
288
|
+
/**
|
|
289
|
+
* summary of the image
|
|
290
|
+
*/
|
|
291
|
+
summary?: string | null;
|
|
292
|
+
/**
|
|
293
|
+
* Model for image URL validation.
|
|
294
|
+
*/
|
|
295
|
+
image_url?: ScoredImageURLInputChunk.ImageURL | null;
|
|
296
|
+
}
|
|
297
|
+
export declare namespace ScoredImageURLInputChunk {
|
|
298
|
+
interface MarkdownChunkGeneratedMetadata {
|
|
299
|
+
type?: 'markdown';
|
|
300
|
+
file_type?: 'text/markdown';
|
|
301
|
+
language: string;
|
|
302
|
+
word_count: number;
|
|
303
|
+
file_size: number;
|
|
304
|
+
chunk_headings?: Array<MarkdownChunkGeneratedMetadata.ChunkHeading>;
|
|
305
|
+
heading_context?: Array<MarkdownChunkGeneratedMetadata.HeadingContext>;
|
|
306
|
+
start_line?: number;
|
|
307
|
+
num_lines?: number;
|
|
308
|
+
frontmatter?: {
|
|
309
|
+
[key: string]: unknown;
|
|
310
|
+
};
|
|
311
|
+
[k: string]: unknown;
|
|
312
|
+
}
|
|
313
|
+
namespace MarkdownChunkGeneratedMetadata {
|
|
314
|
+
interface ChunkHeading {
|
|
315
|
+
level: number;
|
|
316
|
+
text: string;
|
|
317
|
+
}
|
|
318
|
+
interface HeadingContext {
|
|
319
|
+
level: number;
|
|
320
|
+
text: string;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
interface TextChunkGeneratedMetadata {
|
|
324
|
+
type?: 'text';
|
|
325
|
+
file_type?: 'text/plain';
|
|
326
|
+
language: string;
|
|
327
|
+
word_count: number;
|
|
328
|
+
file_size: number;
|
|
329
|
+
start_line?: number;
|
|
330
|
+
num_lines?: number;
|
|
331
|
+
[k: string]: unknown;
|
|
332
|
+
}
|
|
333
|
+
interface PdfChunkGeneratedMetadata {
|
|
334
|
+
type?: 'pdf';
|
|
335
|
+
file_type?: 'application/pdf';
|
|
336
|
+
total_pages: number;
|
|
337
|
+
total_size: number;
|
|
338
|
+
[k: string]: unknown;
|
|
339
|
+
}
|
|
340
|
+
interface CodeChunkGeneratedMetadata {
|
|
341
|
+
type?: 'code';
|
|
342
|
+
file_type: string;
|
|
343
|
+
language: string;
|
|
344
|
+
word_count: number;
|
|
345
|
+
file_size: number;
|
|
346
|
+
start_line?: number;
|
|
347
|
+
num_lines?: number;
|
|
348
|
+
[k: string]: unknown;
|
|
349
|
+
}
|
|
350
|
+
interface AudioChunkGeneratedMetadata {
|
|
351
|
+
type?: 'audio';
|
|
352
|
+
file_type: string;
|
|
353
|
+
file_size: number;
|
|
354
|
+
total_duration_seconds: number;
|
|
355
|
+
sample_rate: number;
|
|
356
|
+
channels: number;
|
|
357
|
+
audio_format: number;
|
|
358
|
+
[k: string]: unknown;
|
|
359
|
+
}
|
|
360
|
+
interface VideoChunkGeneratedMetadata {
|
|
361
|
+
type?: 'video';
|
|
362
|
+
file_type: string;
|
|
363
|
+
file_size: number;
|
|
364
|
+
total_duration_seconds: number;
|
|
365
|
+
fps: number;
|
|
366
|
+
width: number;
|
|
367
|
+
height: number;
|
|
368
|
+
frame_count: number;
|
|
369
|
+
[k: string]: unknown;
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* Model for image URL validation.
|
|
373
|
+
*/
|
|
374
|
+
interface ImageURL {
|
|
375
|
+
/**
|
|
376
|
+
* The image URL. Can be either a URL or a Data URI.
|
|
377
|
+
*/
|
|
378
|
+
url: string;
|
|
379
|
+
/**
|
|
380
|
+
* The image format/mimetype
|
|
381
|
+
*/
|
|
382
|
+
format?: string;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
export interface ScoredTextInputChunk {
|
|
386
|
+
/**
|
|
387
|
+
* position of the chunk in a file
|
|
388
|
+
*/
|
|
389
|
+
chunk_index: number;
|
|
390
|
+
/**
|
|
391
|
+
* mime type of the chunk
|
|
392
|
+
*/
|
|
393
|
+
mime_type?: string;
|
|
394
|
+
/**
|
|
395
|
+
* metadata of the chunk
|
|
396
|
+
*/
|
|
397
|
+
generated_metadata?: ScoredTextInputChunk.MarkdownChunkGeneratedMetadata | ScoredTextInputChunk.TextChunkGeneratedMetadata | ScoredTextInputChunk.PdfChunkGeneratedMetadata | ScoredTextInputChunk.CodeChunkGeneratedMetadata | ScoredTextInputChunk.AudioChunkGeneratedMetadata | ScoredTextInputChunk.VideoChunkGeneratedMetadata | null;
|
|
398
|
+
/**
|
|
399
|
+
* model used for this chunk
|
|
400
|
+
*/
|
|
401
|
+
model?: string | null;
|
|
402
|
+
/**
|
|
403
|
+
* score of the chunk
|
|
404
|
+
*/
|
|
405
|
+
score: number;
|
|
406
|
+
/**
|
|
407
|
+
* file id
|
|
408
|
+
*/
|
|
409
|
+
file_id: string;
|
|
410
|
+
/**
|
|
411
|
+
* filename
|
|
412
|
+
*/
|
|
413
|
+
filename: string;
|
|
414
|
+
/**
|
|
415
|
+
* store id
|
|
416
|
+
*/
|
|
417
|
+
store_id: string;
|
|
418
|
+
/**
|
|
419
|
+
* file metadata
|
|
420
|
+
*/
|
|
421
|
+
metadata?: unknown;
|
|
422
|
+
/**
|
|
423
|
+
* Input type identifier
|
|
424
|
+
*/
|
|
425
|
+
type?: 'text';
|
|
426
|
+
/**
|
|
427
|
+
* The offset of the text in the file relative to the start of the file.
|
|
428
|
+
*/
|
|
429
|
+
offset?: number;
|
|
430
|
+
/**
|
|
431
|
+
* Text content
|
|
432
|
+
*/
|
|
433
|
+
text?: string | null;
|
|
434
|
+
}
|
|
435
|
+
export declare namespace ScoredTextInputChunk {
|
|
436
|
+
interface MarkdownChunkGeneratedMetadata {
|
|
437
|
+
type?: 'markdown';
|
|
438
|
+
file_type?: 'text/markdown';
|
|
439
|
+
language: string;
|
|
440
|
+
word_count: number;
|
|
441
|
+
file_size: number;
|
|
442
|
+
chunk_headings?: Array<MarkdownChunkGeneratedMetadata.ChunkHeading>;
|
|
443
|
+
heading_context?: Array<MarkdownChunkGeneratedMetadata.HeadingContext>;
|
|
444
|
+
start_line?: number;
|
|
445
|
+
num_lines?: number;
|
|
446
|
+
frontmatter?: {
|
|
447
|
+
[key: string]: unknown;
|
|
448
|
+
};
|
|
449
|
+
[k: string]: unknown;
|
|
450
|
+
}
|
|
451
|
+
namespace MarkdownChunkGeneratedMetadata {
|
|
452
|
+
interface ChunkHeading {
|
|
453
|
+
level: number;
|
|
454
|
+
text: string;
|
|
455
|
+
}
|
|
456
|
+
interface HeadingContext {
|
|
457
|
+
level: number;
|
|
458
|
+
text: string;
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
interface TextChunkGeneratedMetadata {
|
|
462
|
+
type?: 'text';
|
|
463
|
+
file_type?: 'text/plain';
|
|
464
|
+
language: string;
|
|
465
|
+
word_count: number;
|
|
466
|
+
file_size: number;
|
|
467
|
+
start_line?: number;
|
|
468
|
+
num_lines?: number;
|
|
469
|
+
[k: string]: unknown;
|
|
470
|
+
}
|
|
471
|
+
interface PdfChunkGeneratedMetadata {
|
|
472
|
+
type?: 'pdf';
|
|
473
|
+
file_type?: 'application/pdf';
|
|
474
|
+
total_pages: number;
|
|
475
|
+
total_size: number;
|
|
476
|
+
[k: string]: unknown;
|
|
477
|
+
}
|
|
478
|
+
interface CodeChunkGeneratedMetadata {
|
|
479
|
+
type?: 'code';
|
|
480
|
+
file_type: string;
|
|
481
|
+
language: string;
|
|
482
|
+
word_count: number;
|
|
483
|
+
file_size: number;
|
|
484
|
+
start_line?: number;
|
|
485
|
+
num_lines?: number;
|
|
486
|
+
[k: string]: unknown;
|
|
487
|
+
}
|
|
488
|
+
interface AudioChunkGeneratedMetadata {
|
|
489
|
+
type?: 'audio';
|
|
490
|
+
file_type: string;
|
|
491
|
+
file_size: number;
|
|
492
|
+
total_duration_seconds: number;
|
|
493
|
+
sample_rate: number;
|
|
494
|
+
channels: number;
|
|
495
|
+
audio_format: number;
|
|
496
|
+
[k: string]: unknown;
|
|
497
|
+
}
|
|
498
|
+
interface VideoChunkGeneratedMetadata {
|
|
499
|
+
type?: 'video';
|
|
500
|
+
file_type: string;
|
|
501
|
+
file_size: number;
|
|
502
|
+
total_duration_seconds: number;
|
|
503
|
+
fps: number;
|
|
504
|
+
width: number;
|
|
505
|
+
height: number;
|
|
506
|
+
frame_count: number;
|
|
507
|
+
[k: string]: unknown;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
export interface ScoredVideoURLInputChunk {
|
|
511
|
+
/**
|
|
512
|
+
* position of the chunk in a file
|
|
513
|
+
*/
|
|
514
|
+
chunk_index: number;
|
|
515
|
+
/**
|
|
516
|
+
* mime type of the chunk
|
|
517
|
+
*/
|
|
518
|
+
mime_type?: string;
|
|
519
|
+
/**
|
|
520
|
+
* metadata of the chunk
|
|
521
|
+
*/
|
|
522
|
+
generated_metadata?: ScoredVideoURLInputChunk.MarkdownChunkGeneratedMetadata | ScoredVideoURLInputChunk.TextChunkGeneratedMetadata | ScoredVideoURLInputChunk.PdfChunkGeneratedMetadata | ScoredVideoURLInputChunk.CodeChunkGeneratedMetadata | ScoredVideoURLInputChunk.AudioChunkGeneratedMetadata | ScoredVideoURLInputChunk.VideoChunkGeneratedMetadata | null;
|
|
523
|
+
/**
|
|
524
|
+
* model used for this chunk
|
|
525
|
+
*/
|
|
526
|
+
model?: string | null;
|
|
527
|
+
/**
|
|
528
|
+
* score of the chunk
|
|
529
|
+
*/
|
|
530
|
+
score: number;
|
|
531
|
+
/**
|
|
532
|
+
* file id
|
|
533
|
+
*/
|
|
534
|
+
file_id: string;
|
|
535
|
+
/**
|
|
536
|
+
* filename
|
|
537
|
+
*/
|
|
538
|
+
filename: string;
|
|
539
|
+
/**
|
|
540
|
+
* store id
|
|
541
|
+
*/
|
|
542
|
+
store_id: string;
|
|
543
|
+
/**
|
|
544
|
+
* file metadata
|
|
545
|
+
*/
|
|
546
|
+
metadata?: unknown;
|
|
547
|
+
/**
|
|
548
|
+
* Input type identifier
|
|
549
|
+
*/
|
|
550
|
+
type?: 'video_url';
|
|
551
|
+
/**
|
|
552
|
+
* speech recognition (sr) text of the video
|
|
553
|
+
*/
|
|
554
|
+
transcription?: string | null;
|
|
555
|
+
/**
|
|
556
|
+
* summary of the video
|
|
557
|
+
*/
|
|
558
|
+
summary?: string | null;
|
|
559
|
+
/**
|
|
560
|
+
* Model for video URL validation.
|
|
561
|
+
*/
|
|
562
|
+
video_url?: ScoredVideoURLInputChunk.VideoURL | null;
|
|
563
|
+
}
|
|
564
|
+
export declare namespace ScoredVideoURLInputChunk {
|
|
565
|
+
interface MarkdownChunkGeneratedMetadata {
|
|
566
|
+
type?: 'markdown';
|
|
567
|
+
file_type?: 'text/markdown';
|
|
568
|
+
language: string;
|
|
569
|
+
word_count: number;
|
|
570
|
+
file_size: number;
|
|
571
|
+
chunk_headings?: Array<MarkdownChunkGeneratedMetadata.ChunkHeading>;
|
|
572
|
+
heading_context?: Array<MarkdownChunkGeneratedMetadata.HeadingContext>;
|
|
573
|
+
start_line?: number;
|
|
574
|
+
num_lines?: number;
|
|
575
|
+
frontmatter?: {
|
|
576
|
+
[key: string]: unknown;
|
|
577
|
+
};
|
|
578
|
+
[k: string]: unknown;
|
|
579
|
+
}
|
|
580
|
+
namespace MarkdownChunkGeneratedMetadata {
|
|
581
|
+
interface ChunkHeading {
|
|
582
|
+
level: number;
|
|
583
|
+
text: string;
|
|
584
|
+
}
|
|
585
|
+
interface HeadingContext {
|
|
586
|
+
level: number;
|
|
587
|
+
text: string;
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
interface TextChunkGeneratedMetadata {
|
|
591
|
+
type?: 'text';
|
|
592
|
+
file_type?: 'text/plain';
|
|
593
|
+
language: string;
|
|
594
|
+
word_count: number;
|
|
595
|
+
file_size: number;
|
|
596
|
+
start_line?: number;
|
|
597
|
+
num_lines?: number;
|
|
598
|
+
[k: string]: unknown;
|
|
599
|
+
}
|
|
600
|
+
interface PdfChunkGeneratedMetadata {
|
|
601
|
+
type?: 'pdf';
|
|
602
|
+
file_type?: 'application/pdf';
|
|
603
|
+
total_pages: number;
|
|
604
|
+
total_size: number;
|
|
605
|
+
[k: string]: unknown;
|
|
606
|
+
}
|
|
607
|
+
interface CodeChunkGeneratedMetadata {
|
|
608
|
+
type?: 'code';
|
|
609
|
+
file_type: string;
|
|
610
|
+
language: string;
|
|
611
|
+
word_count: number;
|
|
612
|
+
file_size: number;
|
|
613
|
+
start_line?: number;
|
|
614
|
+
num_lines?: number;
|
|
615
|
+
[k: string]: unknown;
|
|
616
|
+
}
|
|
617
|
+
interface AudioChunkGeneratedMetadata {
|
|
618
|
+
type?: 'audio';
|
|
619
|
+
file_type: string;
|
|
620
|
+
file_size: number;
|
|
621
|
+
total_duration_seconds: number;
|
|
622
|
+
sample_rate: number;
|
|
623
|
+
channels: number;
|
|
624
|
+
audio_format: number;
|
|
625
|
+
[k: string]: unknown;
|
|
626
|
+
}
|
|
627
|
+
interface VideoChunkGeneratedMetadata {
|
|
628
|
+
type?: 'video';
|
|
629
|
+
file_type: string;
|
|
630
|
+
file_size: number;
|
|
631
|
+
total_duration_seconds: number;
|
|
632
|
+
fps: number;
|
|
633
|
+
width: number;
|
|
634
|
+
height: number;
|
|
635
|
+
frame_count: number;
|
|
636
|
+
[k: string]: unknown;
|
|
637
|
+
}
|
|
638
|
+
/**
|
|
639
|
+
* Model for video URL validation.
|
|
640
|
+
*/
|
|
641
|
+
interface VideoURL {
|
|
642
|
+
/**
|
|
643
|
+
* The video URL. Can be either a URL or a Data URI.
|
|
644
|
+
*/
|
|
645
|
+
url: string;
|
|
646
|
+
}
|
|
647
|
+
}
|
|
89
648
|
/**
|
|
90
649
|
* Model representing a store with its metadata and timestamps.
|
|
91
650
|
*/
|
|
@@ -121,7 +680,7 @@ export interface Store {
|
|
|
121
680
|
/**
|
|
122
681
|
* Represents an expiration policy for a store.
|
|
123
682
|
*/
|
|
124
|
-
expires_after?:
|
|
683
|
+
expires_after?: ExpiresAfter | null;
|
|
125
684
|
/**
|
|
126
685
|
* Processing status of the store
|
|
127
686
|
*/
|
|
@@ -164,6 +723,12 @@ export declare namespace Store {
|
|
|
164
723
|
* Contextualize files with metadata
|
|
165
724
|
*/
|
|
166
725
|
contextualization?: boolean | Config.ContextualizationConfig;
|
|
726
|
+
/**
|
|
727
|
+
* Whether to save original content in the store. When False, only vectors are
|
|
728
|
+
* indexed without the original content (index-only mode). This is useful for data
|
|
729
|
+
* privacy. Note: Reranking is not supported when content is not saved.
|
|
730
|
+
*/
|
|
731
|
+
save_content?: boolean;
|
|
167
732
|
}
|
|
168
733
|
namespace Config {
|
|
169
734
|
interface ContextualizationConfig {
|
|
@@ -222,7 +787,7 @@ export interface StoreChunkSearchOptions {
|
|
|
222
787
|
* Whether to rerank results and optional reranking configuration. Ignored when
|
|
223
788
|
* agentic is enabled (the agent handles ranking).
|
|
224
789
|
*/
|
|
225
|
-
rerank?: boolean |
|
|
790
|
+
rerank?: boolean | StoreChunkSearchOptions.RerankConfig | null;
|
|
226
791
|
/**
|
|
227
792
|
* Whether to use agentic multi-query search with automatic query decomposition and
|
|
228
793
|
* ranking. When enabled, rewrite_query and rerank options are ignored.
|
|
@@ -238,6 +803,24 @@ export interface StoreChunkSearchOptions {
|
|
|
238
803
|
apply_search_rules?: boolean;
|
|
239
804
|
}
|
|
240
805
|
export declare namespace StoreChunkSearchOptions {
|
|
806
|
+
/**
|
|
807
|
+
* Represents a reranking configuration.
|
|
808
|
+
*/
|
|
809
|
+
interface RerankConfig {
|
|
810
|
+
/**
|
|
811
|
+
* The name of the reranking model
|
|
812
|
+
*/
|
|
813
|
+
model?: string;
|
|
814
|
+
/**
|
|
815
|
+
* Whether to include metadata in the reranked results
|
|
816
|
+
*/
|
|
817
|
+
with_metadata?: boolean | Array<string>;
|
|
818
|
+
/**
|
|
819
|
+
* Maximum number of results to return after reranking. If None, returns all
|
|
820
|
+
* reranked results.
|
|
821
|
+
*/
|
|
822
|
+
top_k?: number | null;
|
|
823
|
+
}
|
|
241
824
|
/**
|
|
242
825
|
* Configuration for agentic multi-query search.
|
|
243
826
|
*/
|
|
@@ -297,7 +880,7 @@ export interface StoreQuestionAnsweringResponse {
|
|
|
297
880
|
/**
|
|
298
881
|
* Source documents used to generate the answer
|
|
299
882
|
*/
|
|
300
|
-
sources?: Array<
|
|
883
|
+
sources?: Array<ScoredTextInputChunk | ScoredImageURLInputChunk | ScoredAudioURLInputChunk | ScoredVideoURLInputChunk>;
|
|
301
884
|
}
|
|
302
885
|
export interface StoreSearchResponse {
|
|
303
886
|
/**
|
|
@@ -307,7 +890,7 @@ export interface StoreSearchResponse {
|
|
|
307
890
|
/**
|
|
308
891
|
* The list of scored store file chunks
|
|
309
892
|
*/
|
|
310
|
-
data: Array<
|
|
893
|
+
data: Array<ScoredTextInputChunk | ScoredImageURLInputChunk | ScoredAudioURLInputChunk | ScoredVideoURLInputChunk>;
|
|
311
894
|
}
|
|
312
895
|
export interface StoreCreateParams {
|
|
313
896
|
/**
|
|
@@ -326,7 +909,7 @@ export interface StoreCreateParams {
|
|
|
326
909
|
/**
|
|
327
910
|
* Represents an expiration policy for a store.
|
|
328
911
|
*/
|
|
329
|
-
expires_after?:
|
|
912
|
+
expires_after?: ExpiresAfter | null;
|
|
330
913
|
/**
|
|
331
914
|
* Optional metadata key-value pairs
|
|
332
915
|
*/
|
|
@@ -349,6 +932,12 @@ export declare namespace StoreCreateParams {
|
|
|
349
932
|
* Contextualize files with metadata
|
|
350
933
|
*/
|
|
351
934
|
contextualization?: boolean | Config.ContextualizationConfig;
|
|
935
|
+
/**
|
|
936
|
+
* Whether to save original content in the store. When False, only vectors are
|
|
937
|
+
* indexed without the original content (index-only mode). This is useful for data
|
|
938
|
+
* privacy. Note: Reranking is not supported when content is not saved.
|
|
939
|
+
*/
|
|
940
|
+
save_content?: boolean;
|
|
352
941
|
}
|
|
353
942
|
namespace Config {
|
|
354
943
|
interface ContextualizationConfig {
|
|
@@ -378,7 +967,7 @@ export interface StoreUpdateParams {
|
|
|
378
967
|
/**
|
|
379
968
|
* Represents an expiration policy for a store.
|
|
380
969
|
*/
|
|
381
|
-
expires_after?:
|
|
970
|
+
expires_after?: ExpiresAfter | null;
|
|
382
971
|
/**
|
|
383
972
|
* Optional metadata key-value pairs
|
|
384
973
|
*/
|
|
@@ -474,7 +1063,7 @@ export interface StoreSearchParams {
|
|
|
474
1063
|
/**
|
|
475
1064
|
* Search query text
|
|
476
1065
|
*/
|
|
477
|
-
query: string;
|
|
1066
|
+
query: string | ContentAPI.ImageURLInput | ContentAPI.TextInput;
|
|
478
1067
|
/**
|
|
479
1068
|
* IDs or names of stores to search
|
|
480
1069
|
*/
|
|
@@ -497,7 +1086,7 @@ export interface StoreSearchParams {
|
|
|
497
1086
|
search_options?: StoreChunkSearchOptions;
|
|
498
1087
|
}
|
|
499
1088
|
export declare namespace Stores {
|
|
500
|
-
export { type Store as Store, type StoreChunkSearchOptions as StoreChunkSearchOptions, type StoreDeleteResponse as StoreDeleteResponse, type StoreMetadataFacetsResponse as StoreMetadataFacetsResponse, type StoreQuestionAnsweringResponse as StoreQuestionAnsweringResponse, type StoreSearchResponse as StoreSearchResponse, type StoresCursor as StoresCursor, type StoreCreateParams as StoreCreateParams, type StoreUpdateParams as StoreUpdateParams, type StoreListParams as StoreListParams, type StoreMetadataFacetsParams as StoreMetadataFacetsParams, type StoreQuestionAnsweringParams as StoreQuestionAnsweringParams, type StoreSearchParams as StoreSearchParams, };
|
|
1089
|
+
export { type ExpiresAfter as ExpiresAfter, type ScoredAudioURLInputChunk as ScoredAudioURLInputChunk, type ScoredImageURLInputChunk as ScoredImageURLInputChunk, type ScoredTextInputChunk as ScoredTextInputChunk, type ScoredVideoURLInputChunk as ScoredVideoURLInputChunk, type Store as Store, type StoreChunkSearchOptions as StoreChunkSearchOptions, type StoreDeleteResponse as StoreDeleteResponse, type StoreMetadataFacetsResponse as StoreMetadataFacetsResponse, type StoreQuestionAnsweringResponse as StoreQuestionAnsweringResponse, type StoreSearchResponse as StoreSearchResponse, type StoresCursor as StoresCursor, type StoreCreateParams as StoreCreateParams, type StoreUpdateParams as StoreUpdateParams, type StoreListParams as StoreListParams, type StoreMetadataFacetsParams as StoreMetadataFacetsParams, type StoreQuestionAnsweringParams as StoreQuestionAnsweringParams, type StoreSearchParams as StoreSearchParams, };
|
|
501
1090
|
export { Files as Files, 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, };
|
|
502
1091
|
}
|
|
503
1092
|
//# sourceMappingURL=stores.d.ts.map
|