@mixedbread/sdk 0.16.0 → 0.18.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.
Files changed (50) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/bin/migration-config.json +4 -0
  3. package/client.d.mts +5 -3
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +5 -3
  6. package/client.d.ts.map +1 -1
  7. package/client.js +12 -9
  8. package/client.js.map +1 -1
  9. package/client.mjs +12 -9
  10. package/client.mjs.map +1 -1
  11. package/internal/request-options.d.mts +42 -0
  12. package/internal/request-options.d.mts.map +1 -1
  13. package/internal/request-options.d.ts +42 -0
  14. package/internal/request-options.d.ts.map +1 -1
  15. package/internal/request-options.js.map +1 -1
  16. package/internal/request-options.mjs.map +1 -1
  17. package/package.json +1 -1
  18. package/resources/data-sources/data-sources.d.mts +7 -7
  19. package/resources/data-sources/data-sources.d.mts.map +1 -1
  20. package/resources/data-sources/data-sources.d.ts +7 -7
  21. package/resources/data-sources/data-sources.d.ts.map +1 -1
  22. package/resources/embeddings.d.mts +1 -1
  23. package/resources/embeddings.d.mts.map +1 -1
  24. package/resources/embeddings.d.ts +1 -1
  25. package/resources/embeddings.d.ts.map +1 -1
  26. package/resources/vector-stores/files.d.mts +143 -5
  27. package/resources/vector-stores/files.d.mts.map +1 -1
  28. package/resources/vector-stores/files.d.ts +143 -5
  29. package/resources/vector-stores/files.d.ts.map +1 -1
  30. package/resources/vector-stores/files.js +5 -2
  31. package/resources/vector-stores/files.js.map +1 -1
  32. package/resources/vector-stores/files.mjs +5 -2
  33. package/resources/vector-stores/files.mjs.map +1 -1
  34. package/resources/vector-stores/vector-stores.d.mts +16 -12
  35. package/resources/vector-stores/vector-stores.d.mts.map +1 -1
  36. package/resources/vector-stores/vector-stores.d.ts +16 -12
  37. package/resources/vector-stores/vector-stores.d.ts.map +1 -1
  38. package/resources/vector-stores/vector-stores.js.map +1 -1
  39. package/resources/vector-stores/vector-stores.mjs.map +1 -1
  40. package/src/client.ts +16 -11
  41. package/src/internal/request-options.ts +53 -0
  42. package/src/resources/data-sources/data-sources.ts +7 -7
  43. package/src/resources/embeddings.ts +2 -1
  44. package/src/resources/vector-stores/files.ts +176 -8
  45. package/src/resources/vector-stores/vector-stores.ts +20 -15
  46. package/src/version.ts +1 -1
  47. package/version.d.mts +1 -1
  48. package/version.d.ts +1 -1
  49. package/version.js +1 -1
  50. package/version.mjs +1 -1
@@ -9,17 +9,70 @@ import { type HeadersLike } from './headers';
9
9
  export type FinalRequestOptions = RequestOptions & { method: HTTPMethod; path: string };
10
10
 
11
11
  export type RequestOptions = {
12
+ /**
13
+ * The HTTP method for the request (e.g., 'get', 'post', 'put', 'delete').
14
+ */
12
15
  method?: HTTPMethod;
16
+
17
+ /**
18
+ * The URL path for the request.
19
+ *
20
+ * @example "/v1/foo"
21
+ */
13
22
  path?: string;
23
+
24
+ /**
25
+ * Query parameters to include in the request URL.
26
+ */
14
27
  query?: object | undefined | null;
28
+
29
+ /**
30
+ * The request body. Can be a string, JSON object, FormData, or other supported types.
31
+ */
15
32
  body?: unknown;
33
+
34
+ /**
35
+ * HTTP headers to include with the request. Can be a Headers object, plain object, or array of tuples.
36
+ */
16
37
  headers?: HeadersLike;
38
+
39
+ /**
40
+ * The maximum number of times that the client will retry a request in case of a
41
+ * temporary failure, like a network error or a 5XX error from the server.
42
+ *
43
+ * @default 2
44
+ */
17
45
  maxRetries?: number;
46
+
18
47
  stream?: boolean | undefined;
48
+
49
+ /**
50
+ * The maximum amount of time (in milliseconds) that the client should wait for a response
51
+ * from the server before timing out a single request.
52
+ *
53
+ * @unit milliseconds
54
+ */
19
55
  timeout?: number;
56
+
57
+ /**
58
+ * Additional `RequestInit` options to be passed to the underlying `fetch` call.
59
+ * These options will be merged with the client's default fetch options.
60
+ */
20
61
  fetchOptions?: MergedRequestInit;
62
+
63
+ /**
64
+ * An AbortSignal that can be used to cancel the request.
65
+ */
21
66
  signal?: AbortSignal | undefined | null;
67
+
68
+ /**
69
+ * A unique key for this request to enable idempotency.
70
+ */
22
71
  idempotencyKey?: string;
72
+
73
+ /**
74
+ * Override the default base URL for this specific request.
75
+ */
23
76
  defaultBaseURL?: string | undefined;
24
77
 
25
78
  __binaryResponse?: boolean | undefined;
@@ -156,7 +156,7 @@ export interface DataSourceOauth2Params {
156
156
  /**
157
157
  * The OAuth2 scope
158
158
  */
159
- scope?: string;
159
+ scope?: string | null;
160
160
 
161
161
  /**
162
162
  * The OAuth2 access token
@@ -193,7 +193,7 @@ export interface LinearDataSource {
193
193
  /**
194
194
  * The type of data source to create
195
195
  */
196
- type?: DataSourceType;
196
+ type?: 'linear';
197
197
 
198
198
  /**
199
199
  * The name of the data source
@@ -218,7 +218,7 @@ export interface NotionDataSource {
218
218
  /**
219
219
  * The type of data source to create
220
220
  */
221
- type?: DataSourceType;
221
+ type?: 'notion';
222
222
 
223
223
  /**
224
224
  * The name of the data source
@@ -287,7 +287,7 @@ export declare namespace DataSourceCreateParams {
287
287
  /**
288
288
  * The type of data source to create
289
289
  */
290
- type?: DataSourceType;
290
+ type?: 'notion';
291
291
 
292
292
  /**
293
293
  * The name of the data source
@@ -324,7 +324,7 @@ export declare namespace DataSourceCreateParams {
324
324
  /**
325
325
  * The type of data source to create
326
326
  */
327
- type?: DataSourceType;
327
+ type?: 'linear';
328
328
 
329
329
  /**
330
330
  * The name of the data source
@@ -352,7 +352,7 @@ export declare namespace DataSourceUpdateParams {
352
352
  /**
353
353
  * The type of data source to create
354
354
  */
355
- type?: DataSourceType;
355
+ type?: 'notion';
356
356
 
357
357
  /**
358
358
  * The name of the data source
@@ -389,7 +389,7 @@ export declare namespace DataSourceUpdateParams {
389
389
  /**
390
390
  * The type of data source to create
391
391
  */
392
- type?: DataSourceType;
392
+ type?: 'linear';
393
393
 
394
394
  /**
395
395
  * The name of the data source
@@ -39,7 +39,8 @@ export type ObjectType =
39
39
  | 'vector_store.file'
40
40
  | 'api_key'
41
41
  | 'data_source'
42
- | 'data_source.connector';
42
+ | 'data_source.connector'
43
+ | 'vector_store.histogram';
43
44
 
44
45
  export interface EmbeddingCreateParams {
45
46
  /**
@@ -41,8 +41,11 @@ export class Files extends APIResource {
41
41
  params: FileRetrieveParams,
42
42
  options?: RequestOptions,
43
43
  ): APIPromise<VectorStoreFile> {
44
- const { vector_store_identifier } = params;
45
- return this._client.get(path`/v1/vector_stores/${vector_store_identifier}/files/${fileID}`, options);
44
+ const { vector_store_identifier, ...query } = params;
45
+ return this._client.get(path`/v1/vector_stores/${vector_store_identifier}/files/${fileID}`, {
46
+ query,
47
+ ...options,
48
+ });
46
49
  }
47
50
 
48
51
  /**
@@ -279,11 +282,6 @@ export interface ScoredVectorStoreFile {
279
282
  */
280
283
  object?: 'vector_store.file';
281
284
 
282
- /**
283
- * score of the file
284
- */
285
- score: number;
286
-
287
285
  /**
288
286
  * chunks
289
287
  */
@@ -293,6 +291,11 @@ export interface ScoredVectorStoreFile {
293
291
  | VectorStoresAPI.ScoredAudioURLInputChunk
294
292
  | VectorStoresAPI.ScoredVideoURLInputChunk
295
293
  > | null;
294
+
295
+ /**
296
+ * score of the file
297
+ */
298
+ score: number;
296
299
  }
297
300
 
298
301
  export type VectorStoreFileStatus = 'pending' | 'in_progress' | 'cancelled' | 'completed' | 'failed';
@@ -350,6 +353,166 @@ export interface VectorStoreFile {
350
353
  * Type of the object
351
354
  */
352
355
  object?: 'vector_store.file';
356
+
357
+ /**
358
+ * chunks
359
+ */
360
+ chunks?: Array<
361
+ | VectorStoreFile.TextInputChunk
362
+ | VectorStoreFile.ImageURLInputChunkBase
363
+ | VectorStoreFile.AudioURLInputChunkBase
364
+ | VectorStoreFile.VideoURLInputChunkBase
365
+ > | null;
366
+ }
367
+
368
+ export namespace VectorStoreFile {
369
+ export interface TextInputChunk {
370
+ /**
371
+ * position of the chunk in a file
372
+ */
373
+ chunk_index: number;
374
+
375
+ /**
376
+ * mime type of the chunk
377
+ */
378
+ mime_type?: string;
379
+
380
+ /**
381
+ * metadata of the chunk
382
+ */
383
+ generated_metadata?: { [key: string]: unknown } | null;
384
+
385
+ /**
386
+ * model used for this chunk
387
+ */
388
+ model?: string | null;
389
+
390
+ /**
391
+ * Input type identifier
392
+ */
393
+ type?: 'text';
394
+
395
+ /**
396
+ * The offset of the text in the file relative to the start of the file.
397
+ */
398
+ offset?: number;
399
+
400
+ /**
401
+ * Text content to process
402
+ */
403
+ text: string;
404
+ }
405
+
406
+ export interface ImageURLInputChunkBase {
407
+ /**
408
+ * position of the chunk in a file
409
+ */
410
+ chunk_index: number;
411
+
412
+ /**
413
+ * mime type of the chunk
414
+ */
415
+ mime_type?: string;
416
+
417
+ /**
418
+ * metadata of the chunk
419
+ */
420
+ generated_metadata?: { [key: string]: unknown } | null;
421
+
422
+ /**
423
+ * model used for this chunk
424
+ */
425
+ model?: string | null;
426
+
427
+ /**
428
+ * Input type identifier
429
+ */
430
+ type?: 'image_url';
431
+
432
+ /**
433
+ * ocr text of the image
434
+ */
435
+ ocr_text?: string | null;
436
+
437
+ /**
438
+ * summary of the image
439
+ */
440
+ summary?: string | null;
441
+ }
442
+
443
+ export interface AudioURLInputChunkBase {
444
+ /**
445
+ * position of the chunk in a file
446
+ */
447
+ chunk_index: number;
448
+
449
+ /**
450
+ * mime type of the chunk
451
+ */
452
+ mime_type?: string;
453
+
454
+ /**
455
+ * metadata of the chunk
456
+ */
457
+ generated_metadata?: { [key: string]: unknown } | null;
458
+
459
+ /**
460
+ * model used for this chunk
461
+ */
462
+ model?: string | null;
463
+
464
+ /**
465
+ * Input type identifier
466
+ */
467
+ type?: 'audio_url';
468
+
469
+ /**
470
+ * speech recognition (sr) text of the audio
471
+ */
472
+ transcription?: string | null;
473
+
474
+ /**
475
+ * summary of the audio
476
+ */
477
+ summary?: string | null;
478
+ }
479
+
480
+ export interface VideoURLInputChunkBase {
481
+ /**
482
+ * position of the chunk in a file
483
+ */
484
+ chunk_index: number;
485
+
486
+ /**
487
+ * mime type of the chunk
488
+ */
489
+ mime_type?: string;
490
+
491
+ /**
492
+ * metadata of the chunk
493
+ */
494
+ generated_metadata?: { [key: string]: unknown } | null;
495
+
496
+ /**
497
+ * model used for this chunk
498
+ */
499
+ model?: string | null;
500
+
501
+ /**
502
+ * Input type identifier
503
+ */
504
+ type?: 'video_url';
505
+
506
+ /**
507
+ * speech recognition (sr) text of the video
508
+ */
509
+ transcription?: string | null;
510
+
511
+ /**
512
+ * summary of the video
513
+ */
514
+ summary?: string | null;
515
+ }
353
516
  }
354
517
 
355
518
  /**
@@ -420,9 +583,14 @@ export namespace FileCreateParams {
420
583
 
421
584
  export interface FileRetrieveParams {
422
585
  /**
423
- * The ID or name of the vector store
586
+ * Path param: The ID or name of the vector store
424
587
  */
425
588
  vector_store_identifier: string;
589
+
590
+ /**
591
+ * Query param: Whether to return the chunks for the file
592
+ */
593
+ return_chunks?: boolean;
426
594
  }
427
595
 
428
596
  export interface FileListParams extends CursorParams {
@@ -194,11 +194,6 @@ export interface ScoredAudioURLInputChunk {
194
194
  */
195
195
  type?: 'audio_url';
196
196
 
197
- /**
198
- * The audio input specification.
199
- */
200
- audio_url: ScoredAudioURLInputChunk.AudioURL;
201
-
202
197
  /**
203
198
  * speech recognition (sr) text of the audio
204
199
  */
@@ -208,6 +203,11 @@ export interface ScoredAudioURLInputChunk {
208
203
  * summary of the audio
209
204
  */
210
205
  summary?: string | null;
206
+
207
+ /**
208
+ * The audio input specification.
209
+ */
210
+ audio_url: ScoredAudioURLInputChunk.AudioURL;
211
211
  }
212
212
 
213
213
  export namespace ScoredAudioURLInputChunk {
@@ -273,11 +273,6 @@ export interface ScoredImageURLInputChunk {
273
273
  */
274
274
  type?: 'image_url';
275
275
 
276
- /**
277
- * The image input specification.
278
- */
279
- image_url: ScoredImageURLInputChunk.ImageURL;
280
-
281
276
  /**
282
277
  * ocr text of the image
283
278
  */
@@ -287,6 +282,11 @@ export interface ScoredImageURLInputChunk {
287
282
  * summary of the image
288
283
  */
289
284
  summary?: string | null;
285
+
286
+ /**
287
+ * The image input specification.
288
+ */
289
+ image_url: ScoredImageURLInputChunk.ImageURL;
290
290
  }
291
291
 
292
292
  export namespace ScoredImageURLInputChunk {
@@ -357,6 +357,11 @@ export interface ScoredTextInputChunk {
357
357
  */
358
358
  type?: 'text';
359
359
 
360
+ /**
361
+ * The offset of the text in the file relative to the start of the file.
362
+ */
363
+ offset?: number;
364
+
360
365
  /**
361
366
  * Text content to process
362
367
  */
@@ -414,11 +419,6 @@ export interface ScoredVideoURLInputChunk {
414
419
  */
415
420
  type?: 'video_url';
416
421
 
417
- /**
418
- * The video input specification.
419
- */
420
- video_url: ScoredVideoURLInputChunk.VideoURL;
421
-
422
422
  /**
423
423
  * speech recognition (sr) text of the video
424
424
  */
@@ -428,6 +428,11 @@ export interface ScoredVideoURLInputChunk {
428
428
  * summary of the video
429
429
  */
430
430
  summary?: string | null;
431
+
432
+ /**
433
+ * The video input specification.
434
+ */
435
+ video_url: ScoredVideoURLInputChunk.VideoURL;
431
436
  }
432
437
 
433
438
  export namespace ScoredVideoURLInputChunk {
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.16.0'; // x-release-please-version
1
+ export const VERSION = '0.18.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.16.0";
1
+ export declare const VERSION = "0.18.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.16.0";
1
+ export declare const VERSION = "0.18.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.16.0'; // x-release-please-version
4
+ exports.VERSION = '0.18.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.16.0'; // x-release-please-version
1
+ export const VERSION = '0.18.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map