@mixedbread/sdk 0.5.0 → 0.7.2
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 +83 -0
- package/README.md +12 -24
- package/bin/migration-config.json +105 -2
- package/client.d.mts +12 -28
- package/client.d.mts.map +1 -1
- package/client.d.ts +12 -28
- package/client.d.ts.map +1 -1
- package/client.js +6 -22
- package/client.js.map +1 -1
- package/client.mjs +6 -22
- package/client.mjs.map +1 -1
- package/core/pagination.d.mts +1 -1
- package/core/pagination.d.mts.map +1 -1
- package/core/pagination.d.ts +1 -1
- package/core/pagination.d.ts.map +1 -1
- package/core/resource.d.mts +1 -1
- package/core/resource.d.mts.map +1 -1
- package/core/resource.d.ts +1 -1
- package/core/resource.d.ts.map +1 -1
- package/core/resource.js.map +1 -1
- package/core/resource.mjs.map +1 -1
- package/internal/detect-platform.js +3 -3
- package/internal/detect-platform.js.map +1 -1
- package/internal/detect-platform.mjs +3 -3
- package/internal/detect-platform.mjs.map +1 -1
- package/internal/headers.d.mts.map +1 -1
- package/internal/headers.d.ts.map +1 -1
- package/internal/headers.js +5 -5
- package/internal/headers.js.map +1 -1
- package/internal/headers.mjs +5 -5
- package/internal/headers.mjs.map +1 -1
- package/internal/shim-types.d.mts +11 -22
- package/internal/shim-types.d.mts.map +1 -0
- package/internal/shim-types.d.ts +11 -22
- package/internal/shim-types.d.ts.map +1 -0
- package/internal/shim-types.js +4 -0
- package/internal/shim-types.js.map +1 -0
- package/internal/shim-types.mjs +3 -0
- package/internal/shim-types.mjs.map +1 -0
- package/internal/shims.d.mts +2 -2
- package/internal/shims.d.mts.map +1 -1
- package/internal/shims.d.ts +2 -2
- package/internal/shims.d.ts.map +1 -1
- package/internal/uploads.js +1 -1
- package/internal/uploads.js.map +1 -1
- package/internal/uploads.mjs +1 -1
- package/internal/uploads.mjs.map +1 -1
- package/internal/utils/log.js +1 -1
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs +1 -1
- package/internal/utils/log.mjs.map +1 -1
- package/internal/utils/path.d.mts.map +1 -1
- package/internal/utils/path.d.ts.map +1 -1
- package/internal/utils/path.js.map +1 -1
- package/internal/utils/path.mjs +1 -1
- package/internal/utils/path.mjs.map +1 -1
- package/internal/utils/values.d.mts +2 -0
- package/internal/utils/values.d.mts.map +1 -1
- package/internal/utils/values.d.ts +2 -0
- package/internal/utils/values.d.ts.map +1 -1
- package/internal/utils/values.js +4 -1
- package/internal/utils/values.js.map +1 -1
- package/internal/utils/values.mjs +2 -0
- package/internal/utils/values.mjs.map +1 -1
- package/package.json +1 -7
- package/resources/api-keys.d.mts +171 -0
- package/resources/api-keys.d.mts.map +1 -0
- package/resources/api-keys.d.ts +171 -0
- package/resources/api-keys.d.ts.map +1 -0
- package/resources/api-keys.js +76 -0
- package/resources/api-keys.js.map +1 -0
- package/resources/api-keys.mjs +72 -0
- package/resources/api-keys.mjs.map +1 -0
- package/resources/data-sources/connectors.d.mts +203 -0
- package/resources/data-sources/connectors.d.mts.map +1 -0
- package/resources/data-sources/connectors.d.ts +203 -0
- package/resources/data-sources/connectors.d.ts.map +1 -0
- package/resources/data-sources/connectors.js +73 -0
- package/resources/data-sources/connectors.js.map +1 -0
- package/resources/data-sources/connectors.mjs +69 -0
- package/resources/data-sources/connectors.mjs.map +1 -0
- package/resources/data-sources/data-sources.d.mts +287 -0
- package/resources/data-sources/data-sources.d.mts.map +1 -0
- package/resources/data-sources/data-sources.d.ts +287 -0
- package/resources/data-sources/data-sources.d.ts.map +1 -0
- package/resources/data-sources/data-sources.js +66 -0
- package/resources/data-sources/data-sources.js.map +1 -0
- package/resources/data-sources/data-sources.mjs +61 -0
- package/resources/data-sources/data-sources.mjs.map +1 -0
- package/resources/data-sources/index.d.mts +3 -0
- package/resources/data-sources/index.d.mts.map +1 -0
- package/resources/data-sources/index.d.ts +3 -0
- package/resources/data-sources/index.d.ts.map +1 -0
- package/resources/data-sources/index.js +9 -0
- package/resources/data-sources/index.js.map +1 -0
- package/resources/data-sources/index.mjs +4 -0
- package/resources/data-sources/index.mjs.map +1 -0
- package/resources/data-sources.d.mts +2 -0
- package/resources/data-sources.d.mts.map +1 -0
- package/resources/data-sources.d.ts +2 -0
- package/resources/data-sources.d.ts.map +1 -0
- package/resources/data-sources.js +6 -0
- package/resources/data-sources.js.map +1 -0
- package/resources/data-sources.mjs +3 -0
- package/resources/data-sources.mjs.map +1 -0
- package/resources/embeddings.d.mts +7 -11
- package/resources/embeddings.d.mts.map +1 -1
- package/resources/embeddings.d.ts +7 -11
- package/resources/embeddings.d.ts.map +1 -1
- package/resources/embeddings.js +0 -9
- package/resources/embeddings.js.map +1 -1
- package/resources/embeddings.mjs +0 -9
- package/resources/embeddings.mjs.map +1 -1
- package/resources/extractions/content.d.mts +44 -42
- package/resources/extractions/content.d.mts.map +1 -1
- package/resources/extractions/content.d.ts +44 -42
- package/resources/extractions/content.d.ts.map +1 -1
- package/resources/extractions/extractions.d.mts +2 -2
- package/resources/extractions/extractions.d.mts.map +1 -1
- package/resources/extractions/extractions.d.ts +2 -2
- package/resources/extractions/extractions.d.ts.map +1 -1
- package/resources/extractions/extractions.js.map +1 -1
- package/resources/extractions/extractions.mjs.map +1 -1
- package/resources/extractions/index.d.mts +1 -1
- package/resources/extractions/index.d.mts.map +1 -1
- package/resources/extractions/index.d.ts +1 -1
- package/resources/extractions/index.d.ts.map +1 -1
- package/resources/extractions/index.js.map +1 -1
- package/resources/extractions/index.mjs +1 -1
- package/resources/extractions/index.mjs.map +1 -1
- package/resources/extractions/jobs.d.mts +2 -1
- package/resources/extractions/jobs.d.mts.map +1 -1
- package/resources/extractions/jobs.d.ts +2 -1
- package/resources/extractions/jobs.d.ts.map +1 -1
- package/resources/extractions/jobs.js.map +1 -1
- package/resources/extractions/jobs.mjs.map +1 -1
- package/resources/files.d.mts +18 -1
- package/resources/files.d.mts.map +1 -1
- package/resources/files.d.ts +18 -1
- package/resources/files.d.ts.map +1 -1
- package/resources/index.d.mts +5 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +5 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -0
- package/resources/index.mjs.map +1 -1
- package/resources/parsing/index.d.mts +1 -1
- package/resources/parsing/index.d.mts.map +1 -1
- package/resources/parsing/index.d.ts +1 -1
- package/resources/parsing/index.d.ts.map +1 -1
- package/resources/parsing/index.js.map +1 -1
- package/resources/parsing/index.mjs.map +1 -1
- package/resources/parsing/jobs.d.mts +24 -10
- package/resources/parsing/jobs.d.mts.map +1 -1
- package/resources/parsing/jobs.d.ts +24 -10
- package/resources/parsing/jobs.d.ts.map +1 -1
- package/resources/parsing/jobs.js.map +1 -1
- package/resources/parsing/jobs.mjs.map +1 -1
- package/resources/parsing/parsing.d.mts +2 -2
- package/resources/parsing/parsing.d.mts.map +1 -1
- package/resources/parsing/parsing.d.ts +2 -2
- package/resources/parsing/parsing.d.ts.map +1 -1
- package/resources/parsing/parsing.js.map +1 -1
- package/resources/parsing/parsing.mjs.map +1 -1
- package/resources/top-level.d.mts +5 -4
- package/resources/top-level.d.mts.map +1 -1
- package/resources/top-level.d.ts +5 -4
- package/resources/top-level.d.ts.map +1 -1
- package/resources/vector-stores/files.d.mts +79 -19
- package/resources/vector-stores/files.d.mts.map +1 -1
- package/resources/vector-stores/files.d.ts +79 -19
- package/resources/vector-stores/files.d.ts.map +1 -1
- package/resources/vector-stores/files.js +19 -18
- package/resources/vector-stores/files.js.map +1 -1
- package/resources/vector-stores/files.mjs +19 -18
- package/resources/vector-stores/files.mjs.map +1 -1
- package/resources/vector-stores/index.d.mts +1 -1
- package/resources/vector-stores/index.d.mts.map +1 -1
- package/resources/vector-stores/index.d.ts +1 -1
- package/resources/vector-stores/index.d.ts.map +1 -1
- package/resources/vector-stores/index.js.map +1 -1
- package/resources/vector-stores/index.mjs.map +1 -1
- package/resources/vector-stores/vector-stores.d.mts +275 -90
- package/resources/vector-stores/vector-stores.d.mts.map +1 -1
- package/resources/vector-stores/vector-stores.d.ts +275 -90
- package/resources/vector-stores/vector-stores.d.ts.map +1 -1
- package/resources/vector-stores/vector-stores.js +18 -15
- package/resources/vector-stores/vector-stores.js.map +1 -1
- package/resources/vector-stores/vector-stores.mjs +18 -15
- package/resources/vector-stores/vector-stores.mjs.map +1 -1
- package/src/client.ts +63 -30
- package/src/core/pagination.ts +1 -1
- package/src/core/resource.ts +1 -1
- package/src/internal/detect-platform.ts +3 -3
- package/src/internal/headers.ts +6 -6
- package/src/internal/shim-types.ts +26 -0
- package/src/internal/shims.ts +2 -2
- package/src/internal/uploads.ts +2 -2
- package/src/internal/utils/log.ts +1 -1
- package/src/internal/utils/path.ts +1 -1
- package/src/internal/utils/values.ts +3 -0
- package/src/resources/api-keys.ts +225 -0
- package/src/resources/data-sources/connectors.ts +290 -0
- package/src/resources/data-sources/data-sources.ts +404 -0
- package/src/resources/data-sources/index.ts +24 -0
- package/src/resources/data-sources.ts +3 -0
- package/src/resources/embeddings.ts +25 -19
- package/src/resources/extractions/content.ts +51 -43
- package/src/resources/extractions/extractions.ts +3 -1
- package/src/resources/extractions/index.ts +7 -1
- package/src/resources/extractions/jobs.ts +2 -1
- package/src/resources/files.ts +21 -0
- package/src/resources/index.ts +26 -4
- package/src/resources/parsing/index.ts +4 -0
- package/src/resources/parsing/jobs.ts +42 -44
- package/src/resources/parsing/parsing.ts +8 -0
- package/src/resources/top-level.ts +5 -44
- package/src/resources/vector-stores/files.ts +104 -28
- package/src/resources/vector-stores/index.ts +4 -3
- package/src/resources/vector-stores/vector-stores.ts +330 -102
- 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/src/internal/shim-types.d.ts +0 -28
@@ -6,31 +6,32 @@ import * as VectorStoresAPI from './vector-stores';
|
|
6
6
|
import { APIPromise } from '../../core/api-promise';
|
7
7
|
import { LimitOffset, type LimitOffsetParams, PagePromise } from '../../core/pagination';
|
8
8
|
import { RequestOptions } from '../../internal/request-options';
|
9
|
-
import { path } from '../../internal/utils/path';
|
10
9
|
import * as polling from '../../lib/polling';
|
11
10
|
import { Uploadable } from '../../uploads';
|
11
|
+
import { path } from '../../internal/utils/path';
|
12
12
|
|
13
13
|
export class Files extends APIResource {
|
14
14
|
/**
|
15
15
|
* Upload a new file to a vector store for indexing.
|
16
16
|
*
|
17
|
-
* Args:
|
18
|
-
* upload and index
|
17
|
+
* Args: vector_store_identifier: The ID or name of the vector store to upload to
|
18
|
+
* file: The file to upload and index
|
19
19
|
*
|
20
20
|
* Returns: VectorStoreFile: Details of the uploaded and indexed file
|
21
21
|
*/
|
22
22
|
create(
|
23
|
-
|
23
|
+
vectorStoreIdentifier: string,
|
24
24
|
body: FileCreateParams,
|
25
25
|
options?: RequestOptions,
|
26
26
|
): APIPromise<VectorStoreFile> {
|
27
|
-
return this._client.post(path`/v1/vector_stores/${
|
27
|
+
return this._client.post(path`/v1/vector_stores/${vectorStoreIdentifier}/files`, { body, ...options });
|
28
28
|
}
|
29
29
|
|
30
30
|
/**
|
31
31
|
* Get details of a specific file in a vector store.
|
32
32
|
*
|
33
|
-
* Args:
|
33
|
+
* Args: vector_store_identifier: The ID or name of the vector store file_id: The
|
34
|
+
* ID of the file
|
34
35
|
*
|
35
36
|
* Returns: VectorStoreFile: Details of the vector store file
|
36
37
|
*/
|
@@ -39,25 +40,25 @@ export class Files extends APIResource {
|
|
39
40
|
params: FileRetrieveParams,
|
40
41
|
options?: RequestOptions,
|
41
42
|
): APIPromise<VectorStoreFile> {
|
42
|
-
const {
|
43
|
-
return this._client.get(path`/v1/vector_stores/${
|
43
|
+
const { vector_store_identifier } = params;
|
44
|
+
return this._client.get(path`/v1/vector_stores/${vector_store_identifier}/files/${fileID}`, options);
|
44
45
|
}
|
45
46
|
|
46
47
|
/**
|
47
48
|
* List files indexed in a vector store with pagination.
|
48
49
|
*
|
49
|
-
* Args:
|
50
|
-
* parameters
|
50
|
+
* Args: vector_store_identifier: The ID or name of the vector store pagination:
|
51
|
+
* Pagination parameters
|
51
52
|
*
|
52
53
|
* Returns: VectorStoreFileListResponse: Paginated list of vector store files
|
53
54
|
*/
|
54
55
|
list(
|
55
|
-
|
56
|
+
vectorStoreIdentifier: string,
|
56
57
|
query: FileListParams | null | undefined = {},
|
57
58
|
options?: RequestOptions,
|
58
59
|
): PagePromise<VectorStoreFilesLimitOffset, VectorStoreFile> {
|
59
60
|
return this._client.getAPIList(
|
60
|
-
path`/v1/vector_stores/${
|
61
|
+
path`/v1/vector_stores/${vectorStoreIdentifier}/files`,
|
61
62
|
LimitOffset<VectorStoreFile>,
|
62
63
|
{ query, ...options },
|
63
64
|
);
|
@@ -66,14 +67,14 @@ export class Files extends APIResource {
|
|
66
67
|
/**
|
67
68
|
* Delete a file from a vector store.
|
68
69
|
*
|
69
|
-
* Args:
|
70
|
-
* delete
|
70
|
+
* Args: vector_store_identifier: The ID or name of the vector store file_id: The
|
71
|
+
* ID of the file to delete
|
71
72
|
*
|
72
73
|
* Returns: VectorStoreFileDeleted: The deleted file
|
73
74
|
*/
|
74
75
|
delete(fileID: string, params: FileDeleteParams, options?: RequestOptions): APIPromise<FileDeleteResponse> {
|
75
|
-
const {
|
76
|
-
return this._client.delete(path`/v1/vector_stores/${
|
76
|
+
const { vector_store_identifier } = params;
|
77
|
+
return this._client.delete(path`/v1/vector_stores/${vector_store_identifier}/files/${fileID}`, options);
|
77
78
|
}
|
78
79
|
|
79
80
|
/**
|
@@ -119,9 +120,9 @@ export class Files extends APIResource {
|
|
119
120
|
const pollingTimeoutMs = pollTimeoutMs;
|
120
121
|
|
121
122
|
return polling.poll({
|
122
|
-
fn: () => this.retrieve(fileId, {
|
123
|
+
fn: () => this.retrieve(fileId, { vector_store_identifier: vectorStoreId, ...options }),
|
123
124
|
condition: (result) =>
|
124
|
-
result.status === 'completed' || result.status === 'failed' || result.status === '
|
125
|
+
result.status === 'completed' || result.status === 'failed' || result.status === 'cancelled',
|
125
126
|
intervalSeconds: pollingIntervalMs / 1000,
|
126
127
|
...(pollingTimeoutMs && { timeoutSeconds: pollingTimeoutMs / 1000 }),
|
127
128
|
});
|
@@ -224,7 +225,7 @@ export interface ScoredVectorStoreFile {
|
|
224
225
|
/**
|
225
226
|
* Processing status of the file
|
226
227
|
*/
|
227
|
-
status?:
|
228
|
+
status?: 'pending' | 'in_progress' | 'cancelled' | 'completed' | 'failed';
|
228
229
|
|
229
230
|
/**
|
230
231
|
* Last error message if processing failed
|
@@ -264,7 +265,12 @@ export interface ScoredVectorStoreFile {
|
|
264
265
|
/**
|
265
266
|
* chunks
|
266
267
|
*/
|
267
|
-
chunks: Array<
|
268
|
+
chunks: Array<
|
269
|
+
| VectorStoresAPI.ScoredTextInputChunk
|
270
|
+
| VectorStoresAPI.ScoredImageURLInputChunk
|
271
|
+
| VectorStoresAPI.ScoredAudioURLInputChunk
|
272
|
+
| VectorStoresAPI.ScoredVideoURLInputChunk
|
273
|
+
> | null;
|
268
274
|
}
|
269
275
|
|
270
276
|
/**
|
@@ -289,7 +295,7 @@ export interface VectorStoreFile {
|
|
289
295
|
/**
|
290
296
|
* Processing status of the file
|
291
297
|
*/
|
292
|
-
status?:
|
298
|
+
status?: 'pending' | 'in_progress' | 'cancelled' | 'completed' | 'failed';
|
293
299
|
|
294
300
|
/**
|
295
301
|
* Last error message if processing failed
|
@@ -390,18 +396,18 @@ export namespace FileCreateParams {
|
|
390
396
|
|
391
397
|
export interface FileRetrieveParams {
|
392
398
|
/**
|
393
|
-
* The ID of the vector store
|
399
|
+
* The ID or name of the vector store
|
394
400
|
*/
|
395
|
-
|
401
|
+
vector_store_identifier: string;
|
396
402
|
}
|
397
403
|
|
398
404
|
export interface FileListParams extends LimitOffsetParams {}
|
399
405
|
|
400
406
|
export interface FileDeleteParams {
|
401
407
|
/**
|
402
|
-
* The ID of the vector store
|
408
|
+
* The ID or name of the vector store
|
403
409
|
*/
|
404
|
-
|
410
|
+
vector_store_identifier: string;
|
405
411
|
}
|
406
412
|
|
407
413
|
export interface FileSearchParams {
|
@@ -411,9 +417,14 @@ export interface FileSearchParams {
|
|
411
417
|
query: string;
|
412
418
|
|
413
419
|
/**
|
414
|
-
* IDs of vector stores to search
|
420
|
+
* IDs or names of vector stores to search
|
421
|
+
*/
|
422
|
+
vector_store_identifiers?: Array<string> | null;
|
423
|
+
|
424
|
+
/**
|
425
|
+
* @deprecated
|
415
426
|
*/
|
416
|
-
vector_store_ids
|
427
|
+
vector_store_ids?: Array<string> | null;
|
417
428
|
|
418
429
|
/**
|
419
430
|
* Number of results to return
|
@@ -429,10 +440,75 @@ export interface FileSearchParams {
|
|
429
440
|
| Array<Shared.SearchFilter | Shared.SearchFilterCondition>
|
430
441
|
| null;
|
431
442
|
|
443
|
+
/**
|
444
|
+
* Optional list of file IDs to filter chunks by (inclusion filter)
|
445
|
+
*/
|
446
|
+
file_ids?: Array<unknown> | Array<string> | null;
|
447
|
+
|
432
448
|
/**
|
433
449
|
* Search configuration options
|
434
450
|
*/
|
435
|
-
search_options?:
|
451
|
+
search_options?: FileSearchParams.SearchOptions;
|
452
|
+
}
|
453
|
+
|
454
|
+
export namespace FileSearchParams {
|
455
|
+
/**
|
456
|
+
* Search configuration options
|
457
|
+
*/
|
458
|
+
export interface SearchOptions {
|
459
|
+
/**
|
460
|
+
* Minimum similarity score threshold
|
461
|
+
*/
|
462
|
+
score_threshold?: number;
|
463
|
+
|
464
|
+
/**
|
465
|
+
* Whether to rewrite the query
|
466
|
+
*/
|
467
|
+
rewrite_query?: boolean;
|
468
|
+
|
469
|
+
/**
|
470
|
+
* Whether to rerank results and optional reranking configuration
|
471
|
+
*/
|
472
|
+
rerank?: boolean | SearchOptions.RerankConfig | null;
|
473
|
+
|
474
|
+
/**
|
475
|
+
* Whether to return file metadata
|
476
|
+
*/
|
477
|
+
return_metadata?: boolean;
|
478
|
+
|
479
|
+
/**
|
480
|
+
* Whether to return matching text chunks
|
481
|
+
*/
|
482
|
+
return_chunks?: boolean;
|
483
|
+
|
484
|
+
/**
|
485
|
+
* Number of chunks to return for each file
|
486
|
+
*/
|
487
|
+
chunks_per_file?: number;
|
488
|
+
}
|
489
|
+
|
490
|
+
export namespace SearchOptions {
|
491
|
+
/**
|
492
|
+
* Represents a reranking configuration.
|
493
|
+
*/
|
494
|
+
export interface RerankConfig {
|
495
|
+
/**
|
496
|
+
* The name of the reranking model
|
497
|
+
*/
|
498
|
+
model?: string;
|
499
|
+
|
500
|
+
/**
|
501
|
+
* Whether to include metadata in the reranked results
|
502
|
+
*/
|
503
|
+
with_metadata?: boolean | Array<string>;
|
504
|
+
|
505
|
+
/**
|
506
|
+
* Maximum number of results to return after reranking. If None, returns all
|
507
|
+
* reranked results.
|
508
|
+
*/
|
509
|
+
top_k?: number | null;
|
510
|
+
}
|
511
|
+
}
|
436
512
|
}
|
437
513
|
|
438
514
|
export declare namespace Files {
|
@@ -16,11 +16,12 @@ export {
|
|
16
16
|
export {
|
17
17
|
VectorStores,
|
18
18
|
type ExpiresAfter,
|
19
|
-
type
|
20
|
-
type
|
19
|
+
type ScoredAudioURLInputChunk,
|
20
|
+
type ScoredImageURLInputChunk,
|
21
|
+
type ScoredTextInputChunk,
|
22
|
+
type ScoredVideoURLInputChunk,
|
21
23
|
type VectorStore,
|
22
24
|
type VectorStoreChunkSearchOptions,
|
23
|
-
type VectorStoreFileSearchOptions,
|
24
25
|
type VectorStoreDeleteResponse,
|
25
26
|
type VectorStoreQuestionAnsweringResponse,
|
26
27
|
type VectorStoreSearchResponse,
|