@mixedbread/sdk 0.35.1 → 0.37.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 (52) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/bin/migration-config.json +2 -2
  3. package/client.d.mts +2 -2
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +2 -2
  6. package/client.d.ts.map +1 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs.map +1 -1
  9. package/package.json +1 -1
  10. package/resources/index.d.mts +1 -1
  11. package/resources/index.d.mts.map +1 -1
  12. package/resources/index.d.ts +1 -1
  13. package/resources/index.d.ts.map +1 -1
  14. package/resources/index.js.map +1 -1
  15. package/resources/index.mjs.map +1 -1
  16. package/resources/stores/files.d.mts +21 -21
  17. package/resources/stores/files.d.mts.map +1 -1
  18. package/resources/stores/files.d.ts +21 -21
  19. package/resources/stores/files.d.ts.map +1 -1
  20. package/resources/stores/files.js +5 -2
  21. package/resources/stores/files.js.map +1 -1
  22. package/resources/stores/files.mjs +5 -2
  23. package/resources/stores/files.mjs.map +1 -1
  24. package/resources/stores/index.d.mts +1 -1
  25. package/resources/stores/index.d.mts.map +1 -1
  26. package/resources/stores/index.d.ts +1 -1
  27. package/resources/stores/index.d.ts.map +1 -1
  28. package/resources/stores/index.js.map +1 -1
  29. package/resources/stores/index.mjs.map +1 -1
  30. package/resources/stores/stores.d.mts +96 -1
  31. package/resources/stores/stores.d.mts.map +1 -1
  32. package/resources/stores/stores.d.ts +96 -1
  33. package/resources/stores/stores.d.ts.map +1 -1
  34. package/resources/stores/stores.js +6 -0
  35. package/resources/stores/stores.js.map +1 -1
  36. package/resources/stores/stores.mjs +6 -0
  37. package/resources/stores/stores.mjs.map +1 -1
  38. package/resources/vector-stores/files.d.mts +10 -10
  39. package/resources/vector-stores/files.d.mts.map +1 -1
  40. package/resources/vector-stores/files.d.ts +10 -10
  41. package/resources/vector-stores/files.d.ts.map +1 -1
  42. package/src/client.ts +4 -0
  43. package/src/resources/index.ts +2 -0
  44. package/src/resources/stores/files.ts +33 -26
  45. package/src/resources/stores/index.ts +2 -0
  46. package/src/resources/stores/stores.ts +117 -0
  47. package/src/resources/vector-stores/files.ts +12 -12
  48. package/src/version.ts +1 -1
  49. package/version.d.mts +1 -1
  50. package/version.d.ts +1 -1
  51. package/version.js +1 -1
  52. package/version.mjs +1 -1
@@ -88,6 +88,16 @@ export class Stores extends APIResource {
88
88
  return this._client.delete(path`/v1/stores/${storeIdentifier}`, options);
89
89
  }
90
90
 
91
+ /**
92
+ * Get metadata facets
93
+ */
94
+ metadataFacets(
95
+ body: StoreMetadataFacetsParams,
96
+ options?: RequestOptions,
97
+ ): APIPromise<StoreMetadataFacetsResponse> {
98
+ return this._client.post('/v1/stores/metadata-facets', { body, ...options });
99
+ }
100
+
91
101
  /**
92
102
  * Question answering
93
103
  */
@@ -153,6 +163,11 @@ export interface Store {
153
163
  */
154
164
  metadata?: unknown;
155
165
 
166
+ /**
167
+ * Configuration for a store.
168
+ */
169
+ config?: Store.Config | null;
170
+
156
171
  /**
157
172
  * Counts of files in different states
158
173
  */
@@ -200,6 +215,27 @@ export interface Store {
200
215
  }
201
216
 
202
217
  export namespace Store {
218
+ /**
219
+ * Configuration for a store.
220
+ */
221
+ export interface Config {
222
+ /**
223
+ * Contextualize files with metadata
224
+ */
225
+ contextualization?: boolean | Config.ContextualizationConfig;
226
+ }
227
+
228
+ export namespace Config {
229
+ export interface ContextualizationConfig {
230
+ /**
231
+ * Include all metadata or specific fields in the contextualization. Supports dot
232
+ * notation for nested fields (e.g., 'author.name'). When True, all metadata is
233
+ * included (flattened). When a list, only specified fields are included.
234
+ */
235
+ with_metadata?: boolean | Array<string>;
236
+ }
237
+ }
238
+
203
239
  /**
204
240
  * Counts of files in different states
205
241
  */
@@ -286,6 +322,16 @@ export interface StoreDeleteResponse {
286
322
  object?: 'store';
287
323
  }
288
324
 
325
+ /**
326
+ * Represents metadata facets for a store.
327
+ */
328
+ export interface StoreMetadataFacetsResponse {
329
+ /**
330
+ * Metadata facets
331
+ */
332
+ facets: { [key: string]: { [key: string]: unknown } };
333
+ }
334
+
289
335
  /**
290
336
  * Results from a question answering operation.
291
337
  */
@@ -349,12 +395,40 @@ export interface StoreCreateParams {
349
395
  */
350
396
  metadata?: unknown;
351
397
 
398
+ /**
399
+ * Configuration for a store.
400
+ */
401
+ config?: StoreCreateParams.Config | null;
402
+
352
403
  /**
353
404
  * Optional list of file IDs
354
405
  */
355
406
  file_ids?: Array<string> | null;
356
407
  }
357
408
 
409
+ export namespace StoreCreateParams {
410
+ /**
411
+ * Configuration for a store.
412
+ */
413
+ export interface Config {
414
+ /**
415
+ * Contextualize files with metadata
416
+ */
417
+ contextualization?: boolean | Config.ContextualizationConfig;
418
+ }
419
+
420
+ export namespace Config {
421
+ export interface ContextualizationConfig {
422
+ /**
423
+ * Include all metadata or specific fields in the contextualization. Supports dot
424
+ * notation for nested fields (e.g., 'author.name'). When True, all metadata is
425
+ * included (flattened). When a list, only specified fields are included.
426
+ */
427
+ with_metadata?: boolean | Array<string>;
428
+ }
429
+ }
430
+ }
431
+
358
432
  export interface StoreUpdateParams {
359
433
  /**
360
434
  * New name for the store
@@ -389,6 +463,47 @@ export interface StoreListParams extends CursorParams {
389
463
  q?: string | null;
390
464
  }
391
465
 
466
+ export interface StoreMetadataFacetsParams {
467
+ /**
468
+ * Search query text
469
+ */
470
+ query?: string | null;
471
+
472
+ /**
473
+ * IDs or names of stores to search
474
+ */
475
+ store_identifiers: Array<string>;
476
+
477
+ /**
478
+ * Number of results to return
479
+ */
480
+ top_k?: number;
481
+
482
+ /**
483
+ * Optional filter conditions
484
+ */
485
+ filters?:
486
+ | Shared.SearchFilter
487
+ | Shared.SearchFilterCondition
488
+ | Array<Shared.SearchFilter | Shared.SearchFilterCondition>
489
+ | null;
490
+
491
+ /**
492
+ * Optional list of file IDs to filter chunks by (inclusion filter)
493
+ */
494
+ file_ids?: Array<unknown> | Array<string> | null;
495
+
496
+ /**
497
+ * Search configuration options
498
+ */
499
+ search_options?: StoreChunkSearchOptions;
500
+
501
+ /**
502
+ * Optional list of facets to return. Use dot for nested fields.
503
+ */
504
+ facets?: Array<string> | null;
505
+ }
506
+
392
507
  export interface StoreQuestionAnsweringParams {
393
508
  /**
394
509
  * Question to answer. If not provided, the question will be extracted from the
@@ -496,12 +611,14 @@ export declare namespace Stores {
496
611
  type Store as Store,
497
612
  type StoreChunkSearchOptions as StoreChunkSearchOptions,
498
613
  type StoreDeleteResponse as StoreDeleteResponse,
614
+ type StoreMetadataFacetsResponse as StoreMetadataFacetsResponse,
499
615
  type StoreQuestionAnsweringResponse as StoreQuestionAnsweringResponse,
500
616
  type StoreSearchResponse as StoreSearchResponse,
501
617
  type StoresCursor as StoresCursor,
502
618
  type StoreCreateParams as StoreCreateParams,
503
619
  type StoreUpdateParams as StoreUpdateParams,
504
620
  type StoreListParams as StoreListParams,
621
+ type StoreMetadataFacetsParams as StoreMetadataFacetsParams,
505
622
  type StoreQuestionAnsweringParams as StoreQuestionAnsweringParams,
506
623
  type StoreSearchParams as StoreSearchParams,
507
624
  };
@@ -1740,6 +1740,16 @@ export interface FileCreateParams {
1740
1740
  */
1741
1741
  config?: FileCreateParams.Config;
1742
1742
 
1743
+ /**
1744
+ * External identifier for this file in the store
1745
+ */
1746
+ external_id?: string | null;
1747
+
1748
+ /**
1749
+ * If true, overwrite an existing file with the same external_id
1750
+ */
1751
+ overwrite?: boolean;
1752
+
1743
1753
  /**
1744
1754
  * ID of the file to add
1745
1755
  */
@@ -1757,14 +1767,9 @@ export namespace FileCreateParams {
1757
1767
  */
1758
1768
  export interface Config {
1759
1769
  /**
1760
- * Strategy for adding the file
1770
+ * Strategy for adding the file, this overrides the store-level default
1761
1771
  */
1762
1772
  parsing_strategy?: 'fast' | 'high_quality';
1763
-
1764
- /**
1765
- * Whether to contextualize the file
1766
- */
1767
- contextualization?: boolean;
1768
1773
  }
1769
1774
 
1770
1775
  /**
@@ -1772,14 +1777,9 @@ export namespace FileCreateParams {
1772
1777
  */
1773
1778
  export interface Experimental {
1774
1779
  /**
1775
- * Strategy for adding the file
1780
+ * Strategy for adding the file, this overrides the store-level default
1776
1781
  */
1777
1782
  parsing_strategy?: 'fast' | 'high_quality';
1778
-
1779
- /**
1780
- * Whether to contextualize the file
1781
- */
1782
- contextualization?: boolean;
1783
1783
  }
1784
1784
  }
1785
1785
 
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.35.1'; // x-release-please-version
1
+ export const VERSION = '0.37.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.35.1";
1
+ export declare const VERSION = "0.37.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.35.1";
1
+ export declare const VERSION = "0.37.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.35.1'; // x-release-please-version
4
+ exports.VERSION = '0.37.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.35.1'; // x-release-please-version
1
+ export const VERSION = '0.37.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map