@mixedbread/sdk 0.5.0 → 0.6.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 +33 -0
- package/bin/migration-config.json +103 -0
- package/client.d.mts +15 -28
- package/client.d.mts.map +1 -1
- package/client.d.ts +15 -28
- package/client.d.ts.map +1 -1
- package/client.js +9 -22
- package/client.js.map +1 -1
- package/client.mjs +9 -22
- package/client.mjs.map +1 -1
- package/internal/headers.js +1 -1
- package/internal/headers.js.map +1 -1
- package/internal/headers.mjs +1 -1
- package/internal/headers.mjs.map +1 -1
- package/package.json +1 -4
- 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/chat.d.mts +27 -0
- package/resources/chat.d.mts.map +1 -0
- package/resources/chat.d.ts +27 -0
- package/resources/chat.d.ts.map +1 -0
- package/resources/chat.js +28 -0
- package/resources/chat.js.map +1 -0
- package/resources/chat.mjs +24 -0
- package/resources/chat.mjs.map +1 -0
- package/resources/data-sources/connectors.d.mts +193 -0
- package/resources/data-sources/connectors.d.mts.map +1 -0
- package/resources/data-sources/connectors.d.ts +193 -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 +183 -0
- package/resources/data-sources/data-sources.d.mts.map +1 -0
- package/resources/data-sources/data-sources.d.ts +183 -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 +42 -44
- package/resources/extractions/content.d.mts.map +1 -1
- package/resources/extractions/content.d.ts +42 -44
- 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 +6 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +6 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +7 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -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 +29 -2
- package/resources/vector-stores/files.d.mts.map +1 -1
- package/resources/vector-stores/files.d.ts +29 -2
- package/resources/vector-stores/files.d.ts.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 +209 -79
- package/resources/vector-stores/vector-stores.d.mts.map +1 -1
- package/resources/vector-stores/vector-stores.d.ts +209 -79
- package/resources/vector-stores/vector-stores.d.ts.map +1 -1
- package/resources/vector-stores/vector-stores.js.map +1 -1
- package/resources/vector-stores/vector-stores.mjs.map +1 -1
- package/src/client.ts +68 -30
- package/src/internal/headers.ts +1 -1
- package/src/resources/api-keys.ts +225 -0
- package/src/resources/chat.ts +33 -0
- package/src/resources/data-sources/connectors.ts +280 -0
- package/src/resources/data-sources/data-sources.ts +271 -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 +48 -45
- 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 +27 -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 +39 -2
- package/src/resources/vector-stores/index.ts +4 -3
- package/src/resources/vector-stores/vector-stores.ts +251 -89
- 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
@@ -1,6 +1,7 @@
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
2
|
|
3
3
|
import { APIResource } from '../../core/resource';
|
4
|
+
import * as JobsAPI from './jobs';
|
4
5
|
import { APIPromise } from '../../core/api-promise';
|
5
6
|
import { LimitOffset, type LimitOffsetParams, PagePromise } from '../../core/pagination';
|
6
7
|
import { RequestOptions } from '../../internal/request-options';
|
@@ -162,6 +163,29 @@ export class Jobs extends APIResource {
|
|
162
163
|
|
163
164
|
export type JobListResponsesLimitOffset = LimitOffset<JobListResponse>;
|
164
165
|
|
166
|
+
/**
|
167
|
+
* Strategy used for chunking document content.
|
168
|
+
*/
|
169
|
+
export type ChunkingStrategy = 'page';
|
170
|
+
|
171
|
+
/**
|
172
|
+
* Types of elements that can be extracted from a document.
|
173
|
+
*/
|
174
|
+
export type ElementType =
|
175
|
+
| 'caption'
|
176
|
+
| 'footnote'
|
177
|
+
| 'formula'
|
178
|
+
| 'list-item'
|
179
|
+
| 'page-footer'
|
180
|
+
| 'page-header'
|
181
|
+
| 'picture'
|
182
|
+
| 'section-header'
|
183
|
+
| 'table'
|
184
|
+
| 'text'
|
185
|
+
| 'title';
|
186
|
+
|
187
|
+
export type ParsingJobStatus = 'pending' | 'in_progress' | 'cancelled' | 'completed' | 'failed';
|
188
|
+
|
165
189
|
/**
|
166
190
|
* A job for parsing documents with its current state and result.
|
167
191
|
*/
|
@@ -179,7 +203,7 @@ export interface ParsingJob {
|
|
179
203
|
/**
|
180
204
|
* The status of the job
|
181
205
|
*/
|
182
|
-
status:
|
206
|
+
status: ParsingJobStatus;
|
183
207
|
|
184
208
|
/**
|
185
209
|
* The error of the job
|
@@ -225,29 +249,17 @@ export namespace ParsingJob {
|
|
225
249
|
/**
|
226
250
|
* The strategy used for chunking the document
|
227
251
|
*/
|
228
|
-
chunking_strategy:
|
252
|
+
chunking_strategy: JobsAPI.ChunkingStrategy;
|
229
253
|
|
230
254
|
/**
|
231
255
|
* The format of the returned content
|
232
256
|
*/
|
233
|
-
return_format:
|
257
|
+
return_format: JobsAPI.ReturnFormat;
|
234
258
|
|
235
259
|
/**
|
236
260
|
* The types of elements extracted
|
237
261
|
*/
|
238
|
-
element_types: Array<
|
239
|
-
| 'caption'
|
240
|
-
| 'footnote'
|
241
|
-
| 'formula'
|
242
|
-
| 'list-item'
|
243
|
-
| 'page-footer'
|
244
|
-
| 'page-header'
|
245
|
-
| 'picture'
|
246
|
-
| 'section-header'
|
247
|
-
| 'table'
|
248
|
-
| 'text'
|
249
|
-
| 'title'
|
250
|
-
>;
|
262
|
+
element_types: Array<JobsAPI.ElementType>;
|
251
263
|
|
252
264
|
/**
|
253
265
|
* List of extracted chunks from the document
|
@@ -289,18 +301,7 @@ export namespace ParsingJob {
|
|
289
301
|
/**
|
290
302
|
* The type of the extracted element
|
291
303
|
*/
|
292
|
-
type:
|
293
|
-
| 'caption'
|
294
|
-
| 'footnote'
|
295
|
-
| 'formula'
|
296
|
-
| 'list-item'
|
297
|
-
| 'page-footer'
|
298
|
-
| 'page-header'
|
299
|
-
| 'picture'
|
300
|
-
| 'section-header'
|
301
|
-
| 'table'
|
302
|
-
| 'text'
|
303
|
-
| 'title';
|
304
|
+
type: JobsAPI.ElementType;
|
304
305
|
|
305
306
|
/**
|
306
307
|
* The confidence score of the extraction
|
@@ -331,6 +332,11 @@ export namespace ParsingJob {
|
|
331
332
|
}
|
332
333
|
}
|
333
334
|
|
335
|
+
/**
|
336
|
+
* Format options for the returned document content.
|
337
|
+
*/
|
338
|
+
export type ReturnFormat = 'html' | 'markdown' | 'plain';
|
339
|
+
|
334
340
|
/**
|
335
341
|
* A parsing job item for list responses, omitting result and error fields.
|
336
342
|
*/
|
@@ -348,7 +354,7 @@ export interface JobListResponse {
|
|
348
354
|
/**
|
349
355
|
* The status of the job
|
350
356
|
*/
|
351
|
-
status:
|
357
|
+
status: ParsingJobStatus;
|
352
358
|
|
353
359
|
/**
|
354
360
|
* The started time of the job
|
@@ -405,29 +411,17 @@ export interface JobCreateParams {
|
|
405
411
|
/**
|
406
412
|
* The elements to extract from the document
|
407
413
|
*/
|
408
|
-
element_types?: Array<
|
409
|
-
| 'caption'
|
410
|
-
| 'footnote'
|
411
|
-
| 'formula'
|
412
|
-
| 'list-item'
|
413
|
-
| 'page-footer'
|
414
|
-
| 'page-header'
|
415
|
-
| 'picture'
|
416
|
-
| 'section-header'
|
417
|
-
| 'table'
|
418
|
-
| 'text'
|
419
|
-
| 'title'
|
420
|
-
> | null;
|
414
|
+
element_types?: Array<ElementType> | null;
|
421
415
|
|
422
416
|
/**
|
423
417
|
* The strategy to use for chunking the content
|
424
418
|
*/
|
425
|
-
chunking_strategy?:
|
419
|
+
chunking_strategy?: ChunkingStrategy;
|
426
420
|
|
427
421
|
/**
|
428
422
|
* The format of the returned content
|
429
423
|
*/
|
430
|
-
return_format?:
|
424
|
+
return_format?: ReturnFormat;
|
431
425
|
|
432
426
|
/**
|
433
427
|
* The strategy to use for OCR
|
@@ -439,7 +433,11 @@ export interface JobListParams extends LimitOffsetParams {}
|
|
439
433
|
|
440
434
|
export declare namespace Jobs {
|
441
435
|
export {
|
436
|
+
type ChunkingStrategy as ChunkingStrategy,
|
437
|
+
type ElementType as ElementType,
|
438
|
+
type ParsingJobStatus as ParsingJobStatus,
|
442
439
|
type ParsingJob as ParsingJob,
|
440
|
+
type ReturnFormat as ReturnFormat,
|
443
441
|
type JobListResponse as JobListResponse,
|
444
442
|
type JobDeleteResponse as JobDeleteResponse,
|
445
443
|
type JobListResponsesLimitOffset as JobListResponsesLimitOffset,
|
@@ -3,6 +3,8 @@
|
|
3
3
|
import { APIResource } from '../../core/resource';
|
4
4
|
import * as JobsAPI from './jobs';
|
5
5
|
import {
|
6
|
+
ChunkingStrategy,
|
7
|
+
ElementType,
|
6
8
|
JobCreateParams,
|
7
9
|
JobDeleteResponse,
|
8
10
|
JobListParams,
|
@@ -10,6 +12,8 @@ import {
|
|
10
12
|
JobListResponsesLimitOffset,
|
11
13
|
Jobs,
|
12
14
|
ParsingJob,
|
15
|
+
ParsingJobStatus,
|
16
|
+
ReturnFormat,
|
13
17
|
} from './jobs';
|
14
18
|
|
15
19
|
export class Parsing extends APIResource {
|
@@ -21,7 +25,11 @@ Parsing.Jobs = Jobs;
|
|
21
25
|
export declare namespace Parsing {
|
22
26
|
export {
|
23
27
|
Jobs as Jobs,
|
28
|
+
type ChunkingStrategy as ChunkingStrategy,
|
29
|
+
type ElementType as ElementType,
|
30
|
+
type ParsingJobStatus as ParsingJobStatus,
|
24
31
|
type ParsingJob as ParsingJob,
|
32
|
+
type ReturnFormat as ReturnFormat,
|
25
33
|
type JobListResponse as JobListResponse,
|
26
34
|
type JobDeleteResponse as JobDeleteResponse,
|
27
35
|
type JobListResponsesLimitOffset as JobListResponsesLimitOffset,
|
@@ -1,5 +1,6 @@
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
2
|
|
3
|
+
import * as EmbeddingsAPI from './embeddings';
|
3
4
|
import * as Shared from './shared';
|
4
5
|
|
5
6
|
export interface Embedding {
|
@@ -38,19 +39,7 @@ export interface EmbeddingCreateResponse {
|
|
38
39
|
/**
|
39
40
|
* The object type of the response
|
40
41
|
*/
|
41
|
-
object?:
|
42
|
-
| 'list'
|
43
|
-
| 'parsing_job'
|
44
|
-
| 'extraction_job'
|
45
|
-
| 'embedding'
|
46
|
-
| 'embedding_dict'
|
47
|
-
| 'rank_result'
|
48
|
-
| 'file'
|
49
|
-
| 'vector_store'
|
50
|
-
| 'vector_store.file'
|
51
|
-
| 'api_key'
|
52
|
-
| 'data_source'
|
53
|
-
| 'data_source.connector';
|
42
|
+
object?: EmbeddingsAPI.ObjectType;
|
54
43
|
|
55
44
|
/**
|
56
45
|
* Whether the embeddings are normalized.
|
@@ -60,15 +49,7 @@ export interface EmbeddingCreateResponse {
|
|
60
49
|
/**
|
61
50
|
* The encoding formats of the embeddings.
|
62
51
|
*/
|
63
|
-
encoding_format:
|
64
|
-
| 'float'
|
65
|
-
| 'float16'
|
66
|
-
| 'base64'
|
67
|
-
| 'binary'
|
68
|
-
| 'ubinary'
|
69
|
-
| 'int8'
|
70
|
-
| 'uint8'
|
71
|
-
| Array<'float' | 'float16' | 'base64' | 'binary' | 'ubinary' | 'int8' | 'uint8'>;
|
52
|
+
encoding_format: EmbeddingsAPI.EncodingFormat | Array<EmbeddingsAPI.EncodingFormat>;
|
72
53
|
|
73
54
|
/**
|
74
55
|
* The number of dimensions used for the embeddings.
|
@@ -142,19 +123,7 @@ export interface RerankResponse {
|
|
142
123
|
/**
|
143
124
|
* The object type of the response
|
144
125
|
*/
|
145
|
-
object?:
|
146
|
-
| 'list'
|
147
|
-
| 'parsing_job'
|
148
|
-
| 'extraction_job'
|
149
|
-
| 'embedding'
|
150
|
-
| 'embedding_dict'
|
151
|
-
| 'rank_result'
|
152
|
-
| 'file'
|
153
|
-
| 'vector_store'
|
154
|
-
| 'vector_store.file'
|
155
|
-
| 'api_key'
|
156
|
-
| 'data_source'
|
157
|
-
| 'data_source.connector';
|
126
|
+
object?: 'list';
|
158
127
|
|
159
128
|
/**
|
160
129
|
* The number of documents to return.
|
@@ -221,15 +190,7 @@ export interface EmbedParams {
|
|
221
190
|
* The encoding format(s) of the embeddings. Can be a single format or a list of
|
222
191
|
* formats.
|
223
192
|
*/
|
224
|
-
encoding_format?:
|
225
|
-
| 'float'
|
226
|
-
| 'float16'
|
227
|
-
| 'base64'
|
228
|
-
| 'binary'
|
229
|
-
| 'ubinary'
|
230
|
-
| 'int8'
|
231
|
-
| 'uint8'
|
232
|
-
| Array<'float' | 'float16' | 'base64' | 'binary' | 'ubinary' | 'int8' | 'uint8'>;
|
193
|
+
encoding_format?: EmbeddingsAPI.EncodingFormat | Array<EmbeddingsAPI.EncodingFormat>;
|
233
194
|
}
|
234
195
|
|
235
196
|
export interface RerankParams {
|
@@ -264,7 +264,12 @@ export interface ScoredVectorStoreFile {
|
|
264
264
|
/**
|
265
265
|
* chunks
|
266
266
|
*/
|
267
|
-
chunks: Array<
|
267
|
+
chunks: Array<
|
268
|
+
| VectorStoresAPI.ScoredTextInputChunk
|
269
|
+
| VectorStoresAPI.ScoredImageURLInputChunk
|
270
|
+
| VectorStoresAPI.ScoredAudioURLInputChunk
|
271
|
+
| VectorStoresAPI.ScoredVideoURLInputChunk
|
272
|
+
> | null;
|
268
273
|
}
|
269
274
|
|
270
275
|
/**
|
@@ -432,7 +437,39 @@ export interface FileSearchParams {
|
|
432
437
|
/**
|
433
438
|
* Search configuration options
|
434
439
|
*/
|
435
|
-
search_options?:
|
440
|
+
search_options?: FileSearchParams.SearchOptions;
|
441
|
+
}
|
442
|
+
|
443
|
+
export namespace FileSearchParams {
|
444
|
+
/**
|
445
|
+
* Search configuration options
|
446
|
+
*/
|
447
|
+
export interface SearchOptions {
|
448
|
+
/**
|
449
|
+
* Minimum similarity score threshold
|
450
|
+
*/
|
451
|
+
score_threshold?: number;
|
452
|
+
|
453
|
+
/**
|
454
|
+
* Whether to rewrite the query
|
455
|
+
*/
|
456
|
+
rewrite_query?: boolean;
|
457
|
+
|
458
|
+
/**
|
459
|
+
* Whether to return file metadata
|
460
|
+
*/
|
461
|
+
return_metadata?: boolean;
|
462
|
+
|
463
|
+
/**
|
464
|
+
* Whether to return matching text chunks
|
465
|
+
*/
|
466
|
+
return_chunks?: boolean;
|
467
|
+
|
468
|
+
/**
|
469
|
+
* Number of chunks to return for each file
|
470
|
+
*/
|
471
|
+
chunks_per_file?: number;
|
472
|
+
}
|
436
473
|
}
|
437
474
|
|
438
475
|
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,
|