@mixedbread/sdk 0.29.0 → 0.31.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 +26 -0
- package/README.md +18 -18
- package/bin/cli +4 -10
- package/bin/migration-config.json +70 -0
- package/client.d.mts +3 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +3 -0
- package/client.d.ts.map +1 -1
- package/client.js +3 -0
- package/client.js.map +1 -1
- package/client.mjs +3 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/data-sources/connectors.d.mts +4 -4
- package/resources/data-sources/connectors.d.mts.map +1 -1
- package/resources/data-sources/connectors.d.ts +4 -4
- package/resources/data-sources/connectors.d.ts.map +1 -1
- package/resources/index.d.mts +1 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/stores/files.d.mts +547 -0
- package/resources/stores/files.d.mts.map +1 -0
- package/resources/stores/files.d.ts +547 -0
- package/resources/stores/files.d.ts.map +1 -0
- package/resources/stores/files.js +68 -0
- package/resources/stores/files.js.map +1 -0
- package/resources/stores/files.mjs +64 -0
- package/resources/stores/files.mjs.map +1 -0
- package/resources/stores/index.d.mts +3 -0
- package/resources/stores/index.d.mts.map +1 -0
- package/resources/stores/index.d.ts +3 -0
- package/resources/stores/index.d.ts.map +1 -0
- package/resources/stores/index.js +9 -0
- package/resources/stores/index.js.map +1 -0
- package/resources/stores/index.mjs +4 -0
- package/resources/stores/index.mjs.map +1 -0
- package/resources/stores/stores.d.mts +372 -0
- package/resources/stores/stores.d.mts.map +1 -0
- package/resources/stores/stores.d.ts +372 -0
- package/resources/stores/stores.d.ts.map +1 -0
- package/resources/stores/stores.js +100 -0
- package/resources/stores/stores.js.map +1 -0
- package/resources/stores/stores.mjs +95 -0
- package/resources/stores/stores.mjs.map +1 -0
- package/resources/stores.d.mts +2 -0
- package/resources/stores.d.mts.map +1 -0
- package/resources/stores.d.ts +2 -0
- package/resources/stores.d.ts.map +1 -0
- package/resources/stores.js +6 -0
- package/resources/stores.js.map +1 -0
- package/resources/stores.mjs +3 -0
- package/resources/stores.mjs.map +1 -0
- package/resources/vector-stores/files.d.mts +316 -266
- package/resources/vector-stores/files.d.mts.map +1 -1
- package/resources/vector-stores/files.d.ts +316 -266
- package/resources/vector-stores/files.d.ts.map +1 -1
- package/resources/vector-stores/files.js +10 -35
- package/resources/vector-stores/files.js.map +1 -1
- package/resources/vector-stores/files.mjs +10 -35
- package/resources/vector-stores/files.mjs.map +1 -1
- package/resources/vector-stores/vector-stores.d.mts +593 -275
- package/resources/vector-stores/vector-stores.d.mts.map +1 -1
- package/resources/vector-stores/vector-stores.d.ts +593 -275
- package/resources/vector-stores/vector-stores.d.ts.map +1 -1
- package/resources/vector-stores/vector-stores.js +15 -41
- package/resources/vector-stores/vector-stores.js.map +1 -1
- package/resources/vector-stores/vector-stores.mjs +15 -41
- package/resources/vector-stores/vector-stores.mjs.map +1 -1
- package/src/client.ts +31 -0
- package/src/resources/data-sources/connectors.ts +4 -4
- package/src/resources/index.ts +14 -0
- package/src/resources/stores/files.ts +692 -0
- package/src/resources/stores/index.ts +30 -0
- package/src/resources/stores/stores.ts +523 -0
- package/src/resources/stores.ts +3 -0
- package/src/resources/vector-stores/files.ts +359 -441
- package/src/resources/vector-stores/vector-stores.ts +693 -453
- 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
|
@@ -0,0 +1,547 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import * as Shared from "../shared.js";
|
|
3
|
+
import * as VectorStoresFilesAPI from "../vector-stores/files.js";
|
|
4
|
+
import * as VectorStoresAPI from "../vector-stores/vector-stores.js";
|
|
5
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
6
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
7
|
+
export declare class Files extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Upload a file to a store.
|
|
10
|
+
*
|
|
11
|
+
* Args: store_identifier: The ID or name of the store. file_add_params: The file
|
|
12
|
+
* to add to the store.
|
|
13
|
+
*
|
|
14
|
+
* Returns: VectorStoreFile: The uploaded file details.
|
|
15
|
+
*/
|
|
16
|
+
create(storeIdentifier: string, body: FileCreateParams, options?: RequestOptions): APIPromise<StoreFile>;
|
|
17
|
+
/**
|
|
18
|
+
* Get a file from a store.
|
|
19
|
+
*
|
|
20
|
+
* Args: store_identifier: The ID or name of the store. file_id: The ID or name of
|
|
21
|
+
* the file. options: Get file options.
|
|
22
|
+
*
|
|
23
|
+
* Returns: VectorStoreFile: The file details.
|
|
24
|
+
*/
|
|
25
|
+
retrieve(fileID: string, params: FileRetrieveParams, options?: RequestOptions): APIPromise<StoreFile>;
|
|
26
|
+
/**
|
|
27
|
+
* List files indexed in a vector store with pagination and metadata filter.
|
|
28
|
+
*
|
|
29
|
+
* Args: vector_store_identifier: The ID or name of the vector store pagination:
|
|
30
|
+
* Pagination parameters and metadata filter
|
|
31
|
+
*
|
|
32
|
+
* Returns: VectorStoreFileListResponse: Paginated list of vector store files
|
|
33
|
+
*/
|
|
34
|
+
list(storeIdentifier: string, body: FileListParams, options?: RequestOptions): APIPromise<FileListResponse>;
|
|
35
|
+
/**
|
|
36
|
+
* Delete a file from a store.
|
|
37
|
+
*
|
|
38
|
+
* Args: store_identifier: The ID or name of the store. file_id: The ID or name of
|
|
39
|
+
* the file to delete.
|
|
40
|
+
*
|
|
41
|
+
* Returns: VectorStoreFileDeleted: The deleted file details.
|
|
42
|
+
*/
|
|
43
|
+
delete(fileID: string, params: FileDeleteParams, options?: RequestOptions): APIPromise<FileDeleteResponse>;
|
|
44
|
+
/**
|
|
45
|
+
* Search for files within a store based on semantic similarity.
|
|
46
|
+
*
|
|
47
|
+
* Args: store_identifier: The ID or name of the store to search within
|
|
48
|
+
* search_params: Search configuration including query text, pagination, and
|
|
49
|
+
* filters
|
|
50
|
+
*
|
|
51
|
+
* Returns: StoreFileSearchResponse: List of matching files with relevance scores
|
|
52
|
+
*/
|
|
53
|
+
search(body: FileSearchParams, options?: RequestOptions): APIPromise<FileSearchResponse>;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Represents a scored store file.
|
|
57
|
+
*/
|
|
58
|
+
export interface ScoredStoreFile {
|
|
59
|
+
/**
|
|
60
|
+
* Unique identifier for the file
|
|
61
|
+
*/
|
|
62
|
+
id: string;
|
|
63
|
+
/**
|
|
64
|
+
* Name of the file
|
|
65
|
+
*/
|
|
66
|
+
filename?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Optional file metadata
|
|
69
|
+
*/
|
|
70
|
+
metadata?: unknown;
|
|
71
|
+
/**
|
|
72
|
+
* Processing status of the file
|
|
73
|
+
*/
|
|
74
|
+
status?: StoreFileStatus;
|
|
75
|
+
/**
|
|
76
|
+
* Last error message if processing failed
|
|
77
|
+
*/
|
|
78
|
+
last_error?: unknown;
|
|
79
|
+
/**
|
|
80
|
+
* ID of the containing store
|
|
81
|
+
*/
|
|
82
|
+
store_id: string;
|
|
83
|
+
/**
|
|
84
|
+
* Timestamp of store file creation
|
|
85
|
+
*/
|
|
86
|
+
created_at: string;
|
|
87
|
+
/**
|
|
88
|
+
* Version number of the file
|
|
89
|
+
*/
|
|
90
|
+
version?: number | null;
|
|
91
|
+
/**
|
|
92
|
+
* Storage usage in bytes
|
|
93
|
+
*/
|
|
94
|
+
usage_bytes?: number | null;
|
|
95
|
+
/**
|
|
96
|
+
* Type of the object
|
|
97
|
+
*/
|
|
98
|
+
object?: 'store.file';
|
|
99
|
+
/**
|
|
100
|
+
* Array of scored file chunks
|
|
101
|
+
*/
|
|
102
|
+
chunks: Array<VectorStoresAPI.ScoredTextInputChunk | VectorStoresAPI.ScoredImageURLInputChunk | VectorStoresAPI.ScoredAudioURLInputChunk | VectorStoresAPI.ScoredVideoURLInputChunk> | null;
|
|
103
|
+
/**
|
|
104
|
+
* score of the file
|
|
105
|
+
*/
|
|
106
|
+
score: number;
|
|
107
|
+
}
|
|
108
|
+
export type StoreFileStatus = 'pending' | 'in_progress' | 'cancelled' | 'completed' | 'failed';
|
|
109
|
+
/**
|
|
110
|
+
* Represents a file stored in a store.
|
|
111
|
+
*/
|
|
112
|
+
export interface StoreFile {
|
|
113
|
+
/**
|
|
114
|
+
* Unique identifier for the file
|
|
115
|
+
*/
|
|
116
|
+
id: string;
|
|
117
|
+
/**
|
|
118
|
+
* Name of the file
|
|
119
|
+
*/
|
|
120
|
+
filename?: string;
|
|
121
|
+
/**
|
|
122
|
+
* Optional file metadata
|
|
123
|
+
*/
|
|
124
|
+
metadata?: unknown;
|
|
125
|
+
/**
|
|
126
|
+
* Processing status of the file
|
|
127
|
+
*/
|
|
128
|
+
status?: StoreFileStatus;
|
|
129
|
+
/**
|
|
130
|
+
* Last error message if processing failed
|
|
131
|
+
*/
|
|
132
|
+
last_error?: unknown;
|
|
133
|
+
/**
|
|
134
|
+
* ID of the containing store
|
|
135
|
+
*/
|
|
136
|
+
store_id: string;
|
|
137
|
+
/**
|
|
138
|
+
* Timestamp of store file creation
|
|
139
|
+
*/
|
|
140
|
+
created_at: string;
|
|
141
|
+
/**
|
|
142
|
+
* Version number of the file
|
|
143
|
+
*/
|
|
144
|
+
version?: number | null;
|
|
145
|
+
/**
|
|
146
|
+
* Storage usage in bytes
|
|
147
|
+
*/
|
|
148
|
+
usage_bytes?: number | null;
|
|
149
|
+
/**
|
|
150
|
+
* Type of the object
|
|
151
|
+
*/
|
|
152
|
+
object?: 'store.file';
|
|
153
|
+
/**
|
|
154
|
+
* chunks
|
|
155
|
+
*/
|
|
156
|
+
chunks?: Array<StoreFile.TextInputChunk | StoreFile.ImageURLInputChunk | StoreFile.AudioURLInputChunk | StoreFile.VideoURLInputChunk> | null;
|
|
157
|
+
}
|
|
158
|
+
export declare namespace StoreFile {
|
|
159
|
+
interface TextInputChunk {
|
|
160
|
+
/**
|
|
161
|
+
* position of the chunk in a file
|
|
162
|
+
*/
|
|
163
|
+
chunk_index: number;
|
|
164
|
+
/**
|
|
165
|
+
* mime type of the chunk
|
|
166
|
+
*/
|
|
167
|
+
mime_type?: string;
|
|
168
|
+
/**
|
|
169
|
+
* metadata of the chunk
|
|
170
|
+
*/
|
|
171
|
+
generated_metadata?: {
|
|
172
|
+
[key: string]: unknown;
|
|
173
|
+
} | null;
|
|
174
|
+
/**
|
|
175
|
+
* model used for this chunk
|
|
176
|
+
*/
|
|
177
|
+
model?: string | null;
|
|
178
|
+
/**
|
|
179
|
+
* Input type identifier
|
|
180
|
+
*/
|
|
181
|
+
type?: 'text';
|
|
182
|
+
/**
|
|
183
|
+
* The offset of the text in the file relative to the start of the file.
|
|
184
|
+
*/
|
|
185
|
+
offset?: number;
|
|
186
|
+
/**
|
|
187
|
+
* Text content to process
|
|
188
|
+
*/
|
|
189
|
+
text: string;
|
|
190
|
+
}
|
|
191
|
+
interface ImageURLInputChunk {
|
|
192
|
+
/**
|
|
193
|
+
* position of the chunk in a file
|
|
194
|
+
*/
|
|
195
|
+
chunk_index: number;
|
|
196
|
+
/**
|
|
197
|
+
* mime type of the chunk
|
|
198
|
+
*/
|
|
199
|
+
mime_type?: string;
|
|
200
|
+
/**
|
|
201
|
+
* metadata of the chunk
|
|
202
|
+
*/
|
|
203
|
+
generated_metadata?: {
|
|
204
|
+
[key: string]: unknown;
|
|
205
|
+
} | null;
|
|
206
|
+
/**
|
|
207
|
+
* model used for this chunk
|
|
208
|
+
*/
|
|
209
|
+
model?: string | null;
|
|
210
|
+
/**
|
|
211
|
+
* Input type identifier
|
|
212
|
+
*/
|
|
213
|
+
type?: 'image_url';
|
|
214
|
+
/**
|
|
215
|
+
* ocr text of the image
|
|
216
|
+
*/
|
|
217
|
+
ocr_text?: string | null;
|
|
218
|
+
/**
|
|
219
|
+
* summary of the image
|
|
220
|
+
*/
|
|
221
|
+
summary?: string | null;
|
|
222
|
+
/**
|
|
223
|
+
* The image input specification.
|
|
224
|
+
*/
|
|
225
|
+
image_url: ImageURLInputChunk.ImageURL;
|
|
226
|
+
}
|
|
227
|
+
namespace ImageURLInputChunk {
|
|
228
|
+
/**
|
|
229
|
+
* The image input specification.
|
|
230
|
+
*/
|
|
231
|
+
interface ImageURL {
|
|
232
|
+
/**
|
|
233
|
+
* The image URL. Can be either a URL or a Data URI.
|
|
234
|
+
*/
|
|
235
|
+
url: string;
|
|
236
|
+
/**
|
|
237
|
+
* The image format/mimetype
|
|
238
|
+
*/
|
|
239
|
+
format?: string;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
interface AudioURLInputChunk {
|
|
243
|
+
/**
|
|
244
|
+
* position of the chunk in a file
|
|
245
|
+
*/
|
|
246
|
+
chunk_index: number;
|
|
247
|
+
/**
|
|
248
|
+
* mime type of the chunk
|
|
249
|
+
*/
|
|
250
|
+
mime_type?: string;
|
|
251
|
+
/**
|
|
252
|
+
* metadata of the chunk
|
|
253
|
+
*/
|
|
254
|
+
generated_metadata?: {
|
|
255
|
+
[key: string]: unknown;
|
|
256
|
+
} | null;
|
|
257
|
+
/**
|
|
258
|
+
* model used for this chunk
|
|
259
|
+
*/
|
|
260
|
+
model?: string | null;
|
|
261
|
+
/**
|
|
262
|
+
* Input type identifier
|
|
263
|
+
*/
|
|
264
|
+
type?: 'audio_url';
|
|
265
|
+
/**
|
|
266
|
+
* speech recognition (sr) text of the audio
|
|
267
|
+
*/
|
|
268
|
+
transcription?: string | null;
|
|
269
|
+
/**
|
|
270
|
+
* summary of the audio
|
|
271
|
+
*/
|
|
272
|
+
summary?: string | null;
|
|
273
|
+
/**
|
|
274
|
+
* The audio input specification.
|
|
275
|
+
*/
|
|
276
|
+
audio_url: AudioURLInputChunk.AudioURL;
|
|
277
|
+
/**
|
|
278
|
+
* The sampling rate of the audio.
|
|
279
|
+
*/
|
|
280
|
+
sampling_rate: number;
|
|
281
|
+
}
|
|
282
|
+
namespace AudioURLInputChunk {
|
|
283
|
+
/**
|
|
284
|
+
* The audio input specification.
|
|
285
|
+
*/
|
|
286
|
+
interface AudioURL {
|
|
287
|
+
/**
|
|
288
|
+
* The audio URL. Can be either a URL or a Data URI.
|
|
289
|
+
*/
|
|
290
|
+
url: string;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
interface VideoURLInputChunk {
|
|
294
|
+
/**
|
|
295
|
+
* position of the chunk in a file
|
|
296
|
+
*/
|
|
297
|
+
chunk_index: number;
|
|
298
|
+
/**
|
|
299
|
+
* mime type of the chunk
|
|
300
|
+
*/
|
|
301
|
+
mime_type?: string;
|
|
302
|
+
/**
|
|
303
|
+
* metadata of the chunk
|
|
304
|
+
*/
|
|
305
|
+
generated_metadata?: {
|
|
306
|
+
[key: string]: unknown;
|
|
307
|
+
} | null;
|
|
308
|
+
/**
|
|
309
|
+
* model used for this chunk
|
|
310
|
+
*/
|
|
311
|
+
model?: string | null;
|
|
312
|
+
/**
|
|
313
|
+
* Input type identifier
|
|
314
|
+
*/
|
|
315
|
+
type?: 'video_url';
|
|
316
|
+
/**
|
|
317
|
+
* speech recognition (sr) text of the video
|
|
318
|
+
*/
|
|
319
|
+
transcription?: string | null;
|
|
320
|
+
/**
|
|
321
|
+
* summary of the video
|
|
322
|
+
*/
|
|
323
|
+
summary?: string | null;
|
|
324
|
+
/**
|
|
325
|
+
* The video input specification.
|
|
326
|
+
*/
|
|
327
|
+
video_url: VideoURLInputChunk.VideoURL;
|
|
328
|
+
}
|
|
329
|
+
namespace VideoURLInputChunk {
|
|
330
|
+
/**
|
|
331
|
+
* The video input specification.
|
|
332
|
+
*/
|
|
333
|
+
interface VideoURL {
|
|
334
|
+
/**
|
|
335
|
+
* The video URL. Can be either a URL or a Data URI.
|
|
336
|
+
*/
|
|
337
|
+
url: string;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
export interface FileListResponse {
|
|
342
|
+
/**
|
|
343
|
+
* Response model for cursor-based pagination.
|
|
344
|
+
*/
|
|
345
|
+
pagination: FileListResponse.Pagination;
|
|
346
|
+
/**
|
|
347
|
+
* The object type of the response
|
|
348
|
+
*/
|
|
349
|
+
object?: 'list';
|
|
350
|
+
/**
|
|
351
|
+
* The list of store files
|
|
352
|
+
*/
|
|
353
|
+
data: Array<StoreFile>;
|
|
354
|
+
}
|
|
355
|
+
export declare namespace FileListResponse {
|
|
356
|
+
/**
|
|
357
|
+
* Response model for cursor-based pagination.
|
|
358
|
+
*/
|
|
359
|
+
interface Pagination {
|
|
360
|
+
/**
|
|
361
|
+
* Contextual direction-aware flag: True if more items exist in the requested
|
|
362
|
+
* pagination direction. For 'after': more items after this page. For 'before':
|
|
363
|
+
* more items before this page.
|
|
364
|
+
*/
|
|
365
|
+
has_more: boolean;
|
|
366
|
+
/**
|
|
367
|
+
* Cursor of the first item in this page. Use for backward pagination. None if page
|
|
368
|
+
* is empty.
|
|
369
|
+
*/
|
|
370
|
+
first_cursor: string | null;
|
|
371
|
+
/**
|
|
372
|
+
* Cursor of the last item in this page. Use for forward pagination. None if page
|
|
373
|
+
* is empty.
|
|
374
|
+
*/
|
|
375
|
+
last_cursor: string | null;
|
|
376
|
+
/**
|
|
377
|
+
* Total number of items available across all pages. Only included when
|
|
378
|
+
* include_total=true was requested. Expensive operation - use sparingly.
|
|
379
|
+
*/
|
|
380
|
+
total?: number | null;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Response model for file deletion.
|
|
385
|
+
*/
|
|
386
|
+
export interface FileDeleteResponse {
|
|
387
|
+
/**
|
|
388
|
+
* ID of the deleted file
|
|
389
|
+
*/
|
|
390
|
+
id: string;
|
|
391
|
+
/**
|
|
392
|
+
* Whether the deletion was successful
|
|
393
|
+
*/
|
|
394
|
+
deleted?: boolean;
|
|
395
|
+
/**
|
|
396
|
+
* Type of the deleted object
|
|
397
|
+
*/
|
|
398
|
+
object?: 'store.file';
|
|
399
|
+
}
|
|
400
|
+
export interface FileSearchResponse {
|
|
401
|
+
/**
|
|
402
|
+
* The object type of the response
|
|
403
|
+
*/
|
|
404
|
+
object?: 'list';
|
|
405
|
+
/**
|
|
406
|
+
* The list of scored store files
|
|
407
|
+
*/
|
|
408
|
+
data: Array<ScoredStoreFile>;
|
|
409
|
+
}
|
|
410
|
+
export interface FileCreateParams {
|
|
411
|
+
/**
|
|
412
|
+
* Optional metadata for the file
|
|
413
|
+
*/
|
|
414
|
+
metadata?: unknown;
|
|
415
|
+
/**
|
|
416
|
+
* Strategy for adding the file
|
|
417
|
+
*/
|
|
418
|
+
experimental?: FileCreateParams.Experimental;
|
|
419
|
+
/**
|
|
420
|
+
* ID of the file to add
|
|
421
|
+
*/
|
|
422
|
+
file_id: string;
|
|
423
|
+
}
|
|
424
|
+
export declare namespace FileCreateParams {
|
|
425
|
+
/**
|
|
426
|
+
* Strategy for adding the file
|
|
427
|
+
*/
|
|
428
|
+
interface Experimental {
|
|
429
|
+
/**
|
|
430
|
+
* Strategy for adding the file
|
|
431
|
+
*/
|
|
432
|
+
parsing_strategy?: 'fast' | 'high_quality';
|
|
433
|
+
/**
|
|
434
|
+
* Whether to contextualize the file
|
|
435
|
+
*/
|
|
436
|
+
contextualization?: boolean;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
export interface FileRetrieveParams {
|
|
440
|
+
/**
|
|
441
|
+
* Path param: The ID or name of the store
|
|
442
|
+
*/
|
|
443
|
+
store_identifier: string;
|
|
444
|
+
/**
|
|
445
|
+
* Query param: Whether to return the chunks for the file
|
|
446
|
+
*/
|
|
447
|
+
return_chunks?: boolean;
|
|
448
|
+
}
|
|
449
|
+
export interface FileListParams {
|
|
450
|
+
/**
|
|
451
|
+
* Maximum number of items to return per page (1-100)
|
|
452
|
+
*/
|
|
453
|
+
limit?: number;
|
|
454
|
+
/**
|
|
455
|
+
* Cursor for forward pagination - get items after this position. Use last_cursor
|
|
456
|
+
* from previous response.
|
|
457
|
+
*/
|
|
458
|
+
after?: string | null;
|
|
459
|
+
/**
|
|
460
|
+
* Cursor for backward pagination - get items before this position. Use
|
|
461
|
+
* first_cursor from previous response.
|
|
462
|
+
*/
|
|
463
|
+
before?: string | null;
|
|
464
|
+
/**
|
|
465
|
+
* Whether to include total count in response (expensive operation)
|
|
466
|
+
*/
|
|
467
|
+
include_total?: boolean;
|
|
468
|
+
/**
|
|
469
|
+
* Status to filter by
|
|
470
|
+
*/
|
|
471
|
+
statuses?: Array<StoreFileStatus> | null;
|
|
472
|
+
/**
|
|
473
|
+
* Metadata filter to apply to the query
|
|
474
|
+
*/
|
|
475
|
+
metadata_filter?: Shared.SearchFilter | Shared.SearchFilterCondition | Array<Shared.SearchFilter | Shared.SearchFilterCondition> | null;
|
|
476
|
+
}
|
|
477
|
+
export interface FileDeleteParams {
|
|
478
|
+
/**
|
|
479
|
+
* The ID or name of the store
|
|
480
|
+
*/
|
|
481
|
+
store_identifier: string;
|
|
482
|
+
}
|
|
483
|
+
export interface FileSearchParams {
|
|
484
|
+
/**
|
|
485
|
+
* Search query text
|
|
486
|
+
*/
|
|
487
|
+
query: string;
|
|
488
|
+
/**
|
|
489
|
+
* IDs or names of stores to search
|
|
490
|
+
*/
|
|
491
|
+
store_identifiers: Array<string>;
|
|
492
|
+
/**
|
|
493
|
+
* Number of results to return
|
|
494
|
+
*/
|
|
495
|
+
top_k?: number;
|
|
496
|
+
/**
|
|
497
|
+
* Optional filter conditions
|
|
498
|
+
*/
|
|
499
|
+
filters?: Shared.SearchFilter | Shared.SearchFilterCondition | Array<Shared.SearchFilter | Shared.SearchFilterCondition> | null;
|
|
500
|
+
/**
|
|
501
|
+
* Optional list of file IDs to filter chunks by (inclusion filter)
|
|
502
|
+
*/
|
|
503
|
+
file_ids?: Array<unknown> | Array<string> | null;
|
|
504
|
+
/**
|
|
505
|
+
* Search configuration options
|
|
506
|
+
*/
|
|
507
|
+
search_options?: FileSearchParams.SearchOptions;
|
|
508
|
+
}
|
|
509
|
+
export declare namespace FileSearchParams {
|
|
510
|
+
/**
|
|
511
|
+
* Search configuration options
|
|
512
|
+
*/
|
|
513
|
+
interface SearchOptions {
|
|
514
|
+
/**
|
|
515
|
+
* Minimum similarity score threshold
|
|
516
|
+
*/
|
|
517
|
+
score_threshold?: number;
|
|
518
|
+
/**
|
|
519
|
+
* Whether to rewrite the query
|
|
520
|
+
*/
|
|
521
|
+
rewrite_query?: boolean;
|
|
522
|
+
/**
|
|
523
|
+
* Whether to rerank results and optional reranking configuration
|
|
524
|
+
*/
|
|
525
|
+
rerank?: boolean | VectorStoresFilesAPI.RerankConfig | null;
|
|
526
|
+
/**
|
|
527
|
+
* Whether to return file metadata
|
|
528
|
+
*/
|
|
529
|
+
return_metadata?: boolean;
|
|
530
|
+
/**
|
|
531
|
+
* Whether to return matching text chunks
|
|
532
|
+
*/
|
|
533
|
+
return_chunks?: boolean;
|
|
534
|
+
/**
|
|
535
|
+
* Number of chunks to return for each file
|
|
536
|
+
*/
|
|
537
|
+
chunks_per_file?: number;
|
|
538
|
+
/**
|
|
539
|
+
* Whether to apply search rules
|
|
540
|
+
*/
|
|
541
|
+
apply_search_rules?: boolean;
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
export declare namespace Files {
|
|
545
|
+
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 FileListParams as FileListParams, type FileDeleteParams as FileDeleteParams, type FileSearchParams as FileSearchParams, };
|
|
546
|
+
}
|
|
547
|
+
//# sourceMappingURL=files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../src/resources/stores/files.ts"],"names":[],"mappings":"OAEO,EAA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AAa,CAAC,EAAE,OAAO,CAAC;QAExB;;WAEG;QACH,MAAM,CAAC,EAAE,OAAO,GAAG,oBAAoB,CAAC,YAAY,GAAG,IAAI,CAAC;QAE5D;;WAEG;QACH,eAAe,CAAC,EAAE,OAAO,CAAC;QAE1B;;WAEG;QACH,aAAa,CAAC,EAAE,OAAO,CAAC;QAExB;;WAEG;QACH,eAAe,CAAC,EAAE,MAAM,CAAC;QAEzB;;WAEG;QACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;KAC9B;CACF;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,SAAS,IAAI,SAAS,EAC3B,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Files = void 0;
|
|
5
|
+
const resource_1 = require("../../core/resource.js");
|
|
6
|
+
const path_1 = require("../../internal/utils/path.js");
|
|
7
|
+
class Files extends resource_1.APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Upload a file to a store.
|
|
10
|
+
*
|
|
11
|
+
* Args: store_identifier: The ID or name of the store. file_add_params: The file
|
|
12
|
+
* to add to the store.
|
|
13
|
+
*
|
|
14
|
+
* Returns: VectorStoreFile: The uploaded file details.
|
|
15
|
+
*/
|
|
16
|
+
create(storeIdentifier, body, options) {
|
|
17
|
+
return this._client.post((0, path_1.path) `/v1/stores/${storeIdentifier}/files`, { body, ...options });
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Get a file from a store.
|
|
21
|
+
*
|
|
22
|
+
* Args: store_identifier: The ID or name of the store. file_id: The ID or name of
|
|
23
|
+
* the file. options: Get file options.
|
|
24
|
+
*
|
|
25
|
+
* Returns: VectorStoreFile: The file details.
|
|
26
|
+
*/
|
|
27
|
+
retrieve(fileID, params, options) {
|
|
28
|
+
const { store_identifier, ...query } = params;
|
|
29
|
+
return this._client.get((0, path_1.path) `/v1/stores/${store_identifier}/files/${fileID}`, { query, ...options });
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* List files indexed in a vector store with pagination and metadata filter.
|
|
33
|
+
*
|
|
34
|
+
* Args: vector_store_identifier: The ID or name of the vector store pagination:
|
|
35
|
+
* Pagination parameters and metadata filter
|
|
36
|
+
*
|
|
37
|
+
* Returns: VectorStoreFileListResponse: Paginated list of vector store files
|
|
38
|
+
*/
|
|
39
|
+
list(storeIdentifier, body, options) {
|
|
40
|
+
return this._client.post((0, path_1.path) `/v1/stores/${storeIdentifier}/files/list`, { body, ...options });
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Delete a file from a store.
|
|
44
|
+
*
|
|
45
|
+
* Args: store_identifier: The ID or name of the store. file_id: The ID or name of
|
|
46
|
+
* the file to delete.
|
|
47
|
+
*
|
|
48
|
+
* Returns: VectorStoreFileDeleted: The deleted file details.
|
|
49
|
+
*/
|
|
50
|
+
delete(fileID, params, options) {
|
|
51
|
+
const { store_identifier } = params;
|
|
52
|
+
return this._client.delete((0, path_1.path) `/v1/stores/${store_identifier}/files/${fileID}`, options);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Search for files within a store based on semantic similarity.
|
|
56
|
+
*
|
|
57
|
+
* Args: store_identifier: The ID or name of the store to search within
|
|
58
|
+
* search_params: Search configuration including query text, pagination, and
|
|
59
|
+
* filters
|
|
60
|
+
*
|
|
61
|
+
* Returns: StoreFileSearchResponse: List of matching files with relevance scores
|
|
62
|
+
*/
|
|
63
|
+
search(body, options) {
|
|
64
|
+
return this._client.post('/v1/stores/files/search', { body, ...options });
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.Files = Files;
|
|
68
|
+
//# sourceMappingURL=files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../src/resources/stores/files.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAMlD,uDAAiD;AAEjD,MAAa,KAAM,SAAQ,sBAAW;IACpC;;;;;;;OAOG;IACH,MAAM,CAAC,eAAuB,EAAE,IAAsB,EAAE,OAAwB;QAC9E,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,cAAc,eAAe,QAAQ,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5F,CAAC;IAED;;;;;;;OAOG;IACH,QAAQ,CAAC,MAAc,EAAE,MAA0B,EAAE,OAAwB;QAC3E,MAAM,EAAE,gBAAgB,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,cAAc,gBAAgB,UAAU,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvG,CAAC;IAED;;;;;;;OAOG;IACH,IAAI,CACF,eAAuB,EACvB,IAAoB,EACpB,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,cAAc,eAAe,aAAa,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjG,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,MAAc,EAAE,MAAwB,EAAE,OAAwB;QACvE,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,CAAC;QACpC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,cAAc,gBAAgB,UAAU,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IAC5F,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,IAAsB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,yBAAyB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;CACF;AAnED,sBAmEC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
+
import { path } from "../../internal/utils/path.mjs";
|
|
4
|
+
export class Files extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Upload a file to a store.
|
|
7
|
+
*
|
|
8
|
+
* Args: store_identifier: The ID or name of the store. file_add_params: The file
|
|
9
|
+
* to add to the store.
|
|
10
|
+
*
|
|
11
|
+
* Returns: VectorStoreFile: The uploaded file details.
|
|
12
|
+
*/
|
|
13
|
+
create(storeIdentifier, body, options) {
|
|
14
|
+
return this._client.post(path `/v1/stores/${storeIdentifier}/files`, { body, ...options });
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Get a file from a store.
|
|
18
|
+
*
|
|
19
|
+
* Args: store_identifier: The ID or name of the store. file_id: The ID or name of
|
|
20
|
+
* the file. options: Get file options.
|
|
21
|
+
*
|
|
22
|
+
* Returns: VectorStoreFile: The file details.
|
|
23
|
+
*/
|
|
24
|
+
retrieve(fileID, params, options) {
|
|
25
|
+
const { store_identifier, ...query } = params;
|
|
26
|
+
return this._client.get(path `/v1/stores/${store_identifier}/files/${fileID}`, { query, ...options });
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* List files indexed in a vector store with pagination and metadata filter.
|
|
30
|
+
*
|
|
31
|
+
* Args: vector_store_identifier: The ID or name of the vector store pagination:
|
|
32
|
+
* Pagination parameters and metadata filter
|
|
33
|
+
*
|
|
34
|
+
* Returns: VectorStoreFileListResponse: Paginated list of vector store files
|
|
35
|
+
*/
|
|
36
|
+
list(storeIdentifier, body, options) {
|
|
37
|
+
return this._client.post(path `/v1/stores/${storeIdentifier}/files/list`, { body, ...options });
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Delete a file from a store.
|
|
41
|
+
*
|
|
42
|
+
* Args: store_identifier: The ID or name of the store. file_id: The ID or name of
|
|
43
|
+
* the file to delete.
|
|
44
|
+
*
|
|
45
|
+
* Returns: VectorStoreFileDeleted: The deleted file details.
|
|
46
|
+
*/
|
|
47
|
+
delete(fileID, params, options) {
|
|
48
|
+
const { store_identifier } = params;
|
|
49
|
+
return this._client.delete(path `/v1/stores/${store_identifier}/files/${fileID}`, options);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Search for files within a store based on semantic similarity.
|
|
53
|
+
*
|
|
54
|
+
* Args: store_identifier: The ID or name of the store to search within
|
|
55
|
+
* search_params: Search configuration including query text, pagination, and
|
|
56
|
+
* filters
|
|
57
|
+
*
|
|
58
|
+
* Returns: StoreFileSearchResponse: List of matching files with relevance scores
|
|
59
|
+
*/
|
|
60
|
+
search(body, options) {
|
|
61
|
+
return this._client.post('/v1/stores/files/search', { body, ...options });
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=files.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.mjs","sourceRoot":"","sources":["../../src/resources/stores/files.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAMf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;;;;;;OAOG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