@mixedbread/sdk 0.7.2 → 0.9.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 (78) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/client.d.mts +10 -7
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +10 -7
  5. package/client.d.ts.map +1 -1
  6. package/client.js +28 -22
  7. package/client.js.map +1 -1
  8. package/client.mjs +17 -11
  9. package/client.mjs.map +1 -1
  10. package/internal/request-options.d.mts +1 -0
  11. package/internal/request-options.d.mts.map +1 -1
  12. package/internal/request-options.d.ts +1 -0
  13. package/internal/request-options.d.ts.map +1 -1
  14. package/internal/request-options.js.map +1 -1
  15. package/internal/request-options.mjs.map +1 -1
  16. package/package.json +1 -1
  17. package/resources/chat.d.mts +27 -0
  18. package/resources/chat.d.mts.map +1 -0
  19. package/resources/chat.d.ts +27 -0
  20. package/resources/chat.d.ts.map +1 -0
  21. package/resources/chat.js +28 -0
  22. package/resources/chat.js.map +1 -0
  23. package/resources/chat.mjs +24 -0
  24. package/resources/chat.mjs.map +1 -0
  25. package/resources/data-sources/data-sources.d.mts +74 -41
  26. package/resources/data-sources/data-sources.d.mts.map +1 -1
  27. package/resources/data-sources/data-sources.d.ts +74 -41
  28. package/resources/data-sources/data-sources.d.ts.map +1 -1
  29. package/resources/data-sources/data-sources.js.map +1 -1
  30. package/resources/data-sources/data-sources.mjs.map +1 -1
  31. package/resources/data-sources/index.d.mts +1 -1
  32. package/resources/data-sources/index.d.mts.map +1 -1
  33. package/resources/data-sources/index.d.ts +1 -1
  34. package/resources/data-sources/index.d.ts.map +1 -1
  35. package/resources/data-sources/index.js.map +1 -1
  36. package/resources/data-sources/index.mjs.map +1 -1
  37. package/resources/index.d.mts +2 -1
  38. package/resources/index.d.mts.map +1 -1
  39. package/resources/index.d.ts +2 -1
  40. package/resources/index.d.ts.map +1 -1
  41. package/resources/index.js +3 -1
  42. package/resources/index.js.map +1 -1
  43. package/resources/index.mjs +1 -0
  44. package/resources/index.mjs.map +1 -1
  45. package/resources/vector-stores/files.d.mts +32 -32
  46. package/resources/vector-stores/files.d.mts.map +1 -1
  47. package/resources/vector-stores/files.d.ts +32 -32
  48. package/resources/vector-stores/files.d.ts.map +1 -1
  49. package/resources/vector-stores/files.js +14 -14
  50. package/resources/vector-stores/files.js.map +1 -1
  51. package/resources/vector-stores/files.mjs +14 -14
  52. package/resources/vector-stores/files.mjs.map +1 -1
  53. package/resources/vector-stores/index.d.mts +1 -1
  54. package/resources/vector-stores/index.d.mts.map +1 -1
  55. package/resources/vector-stores/index.d.ts +1 -1
  56. package/resources/vector-stores/index.d.ts.map +1 -1
  57. package/resources/vector-stores/index.js.map +1 -1
  58. package/resources/vector-stores/index.mjs.map +1 -1
  59. package/resources/vector-stores/vector-stores.d.mts +15 -23
  60. package/resources/vector-stores/vector-stores.d.mts.map +1 -1
  61. package/resources/vector-stores/vector-stores.d.ts +15 -23
  62. package/resources/vector-stores/vector-stores.d.ts.map +1 -1
  63. package/resources/vector-stores/vector-stores.js.map +1 -1
  64. package/resources/vector-stores/vector-stores.mjs.map +1 -1
  65. package/src/client.ts +39 -11
  66. package/src/internal/request-options.ts +1 -0
  67. package/src/resources/chat.ts +33 -0
  68. package/src/resources/data-sources/data-sources.ts +89 -52
  69. package/src/resources/data-sources/index.ts +3 -0
  70. package/src/resources/index.ts +4 -0
  71. package/src/resources/vector-stores/files.ts +43 -40
  72. package/src/resources/vector-stores/index.ts +2 -0
  73. package/src/resources/vector-stores/vector-stores.ts +20 -24
  74. package/src/version.ts +1 -1
  75. package/version.d.mts +1 -1
  76. package/version.d.ts +1 -1
  77. package/version.js +1 -1
  78. 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 FilesAPI from './files';
4
5
  import * as Shared from '../shared';
5
6
  import * as VectorStoresAPI from './vector-stores';
6
7
  import { APIPromise } from '../../core/api-promise';
@@ -102,7 +103,7 @@ export class Files extends APIResource {
102
103
  /**
103
104
  * Poll for a file's processing status until it reaches a terminal state.
104
105
  *
105
- * @param vectorStoreId - The ID of the vector store
106
+ * @param vectorStoreIdentifier - The identifier of the vector store
106
107
  * @param fileId - The ID of the file to poll
107
108
  * @param pollIntervalMs - The interval between polls in milliseconds (default: 500)
108
109
  * @param pollTimeoutMs - The maximum time to poll for in milliseconds (default: no timeout)
@@ -110,7 +111,7 @@ export class Files extends APIResource {
110
111
  * @returns The file object once it reaches a terminal state
111
112
  */
112
113
  async poll(
113
- vectorStoreId: string,
114
+ vectorStoreIdentifier: string,
114
115
  fileId: string,
115
116
  pollIntervalMs?: number,
116
117
  pollTimeoutMs?: number,
@@ -120,7 +121,7 @@ export class Files extends APIResource {
120
121
  const pollingTimeoutMs = pollTimeoutMs;
121
122
 
122
123
  return polling.poll({
123
- fn: () => this.retrieve(fileId, { vector_store_identifier: vectorStoreId, ...options }),
124
+ fn: () => this.retrieve(fileId, { vector_store_identifier: vectorStoreIdentifier, ...options }),
124
125
  condition: (result) =>
125
126
  result.status === 'completed' || result.status === 'failed' || result.status === 'cancelled',
126
127
  intervalSeconds: pollingIntervalMs / 1000,
@@ -131,7 +132,7 @@ export class Files extends APIResource {
131
132
  /**
132
133
  * Create a file in a vector store and wait for it to be processed.
133
134
  *
134
- * @param vectorStoreId - The ID of the vector store to upload to
135
+ * @param vectorStoreIdentifier - The identifier of the vector store to upload to
135
136
  * @param body - The file creation parameters
136
137
  * @param pollIntervalMs - The interval between polls in milliseconds (default: 500)
137
138
  * @param pollTimeoutMs - The maximum time to poll for in milliseconds (default: no timeout)
@@ -139,28 +140,28 @@ export class Files extends APIResource {
139
140
  * @returns The file object once it reaches a terminal state
140
141
  */
141
142
  async createAndPoll(
142
- vectorStoreId: string,
143
+ vectorStoreIdentifier: string,
143
144
  body: FileCreateParams,
144
145
  pollIntervalMs?: number,
145
146
  pollTimeoutMs?: number,
146
147
  options?: RequestOptions,
147
148
  ): Promise<VectorStoreFile> {
148
- const file = await this.create(vectorStoreId, body, options);
149
- return this.poll(vectorStoreId, file.id, pollIntervalMs, pollTimeoutMs, options);
149
+ const file = await this.create(vectorStoreIdentifier, body, options);
150
+ return this.poll(vectorStoreIdentifier, file.id, pollIntervalMs, pollTimeoutMs, options);
150
151
  }
151
152
 
152
153
  /**
153
154
  * Upload a file to the files API and then create a file in a vector store.
154
155
  * Note the file will be asynchronously processed.
155
156
  *
156
- * @param vectorStoreId - The ID of the vector store to add the file to
157
+ * @param vectorStoreIdentifier - The identifier of the vector store to add the file to
157
158
  * @param file - The file to upload
158
159
  * @param body - Additional parameters for the vector store file
159
160
  * @param options - Additional request options
160
161
  * @returns The created vector store file
161
162
  */
162
163
  async upload(
163
- vectorStoreId: string,
164
+ vectorStoreIdentifier: string,
164
165
  file: Uploadable,
165
166
  body?: Omit<FileCreateParams, 'file_id'>,
166
167
  options?: RequestOptions,
@@ -168,7 +169,7 @@ export class Files extends APIResource {
168
169
  const fileUploadResponse = await this._client.files.create({ file }, options);
169
170
 
170
171
  return this.create(
171
- vectorStoreId,
172
+ vectorStoreIdentifier,
172
173
  {
173
174
  file_id: fileUploadResponse.id,
174
175
  ...body,
@@ -180,7 +181,7 @@ export class Files extends APIResource {
180
181
  /**
181
182
  * Upload a file to files API, create a file in a vector store, and poll until processing is complete.
182
183
  *
183
- * @param vectorStoreId - The ID of the vector store to add the file to
184
+ * @param vectorStoreIdentifier - The identifier of the vector store to add the file to
184
185
  * @param file - The file to upload
185
186
  * @param body - Additional parameters for the vector store file
186
187
  * @param pollIntervalMs - The interval between polls in milliseconds (default: 500)
@@ -189,20 +190,41 @@ export class Files extends APIResource {
189
190
  * @returns The vector store file object once it reaches a terminal state
190
191
  */
191
192
  async uploadAndPoll(
192
- vectorStoreId: string,
193
+ vectorStoreIdentifier: string,
193
194
  file: Uploadable,
194
195
  body?: Omit<FileCreateParams, 'file_id'>,
195
196
  pollIntervalMs?: number,
196
197
  pollTimeoutMs?: number,
197
198
  options?: RequestOptions,
198
199
  ): Promise<VectorStoreFile> {
199
- const vectorStoreFile = await this.upload(vectorStoreId, file, body, options);
200
- return this.poll(vectorStoreId, vectorStoreFile.id, pollIntervalMs, pollTimeoutMs, options);
200
+ const vectorStoreFile = await this.upload(vectorStoreIdentifier, file, body, options);
201
+ return this.poll(vectorStoreIdentifier, vectorStoreFile.id, pollIntervalMs, pollTimeoutMs, options);
201
202
  }
202
203
  }
203
204
 
204
205
  export type VectorStoreFilesLimitOffset = LimitOffset<VectorStoreFile>;
205
206
 
207
+ /**
208
+ * Represents a reranking configuration.
209
+ */
210
+ export interface RerankConfig {
211
+ /**
212
+ * The name of the reranking model
213
+ */
214
+ model?: string;
215
+
216
+ /**
217
+ * Whether to include metadata in the reranked results
218
+ */
219
+ with_metadata?: boolean | Array<string>;
220
+
221
+ /**
222
+ * Maximum number of results to return after reranking. If None, returns all
223
+ * reranked results.
224
+ */
225
+ top_k?: number | null;
226
+ }
227
+
206
228
  /**
207
229
  * Represents a scored file stored in a vector store.
208
230
  */
@@ -225,7 +247,7 @@ export interface ScoredVectorStoreFile {
225
247
  /**
226
248
  * Processing status of the file
227
249
  */
228
- status?: 'pending' | 'in_progress' | 'cancelled' | 'completed' | 'failed';
250
+ status?: VectorStoreFileStatus;
229
251
 
230
252
  /**
231
253
  * Last error message if processing failed
@@ -273,6 +295,8 @@ export interface ScoredVectorStoreFile {
273
295
  > | null;
274
296
  }
275
297
 
298
+ export type VectorStoreFileStatus = 'pending' | 'in_progress' | 'cancelled' | 'completed' | 'failed';
299
+
276
300
  /**
277
301
  * Represents a file stored in a vector store.
278
302
  */
@@ -295,7 +319,7 @@ export interface VectorStoreFile {
295
319
  /**
296
320
  * Processing status of the file
297
321
  */
298
- status?: 'pending' | 'in_progress' | 'cancelled' | 'completed' | 'failed';
322
+ status?: VectorStoreFileStatus;
299
323
 
300
324
  /**
301
325
  * Last error message if processing failed
@@ -469,7 +493,7 @@ export namespace FileSearchParams {
469
493
  /**
470
494
  * Whether to rerank results and optional reranking configuration
471
495
  */
472
- rerank?: boolean | SearchOptions.RerankConfig | null;
496
+ rerank?: boolean | FilesAPI.RerankConfig | null;
473
497
 
474
498
  /**
475
499
  * Whether to return file metadata
@@ -486,34 +510,13 @@ export namespace FileSearchParams {
486
510
  */
487
511
  chunks_per_file?: number;
488
512
  }
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
- }
512
513
  }
513
514
 
514
515
  export declare namespace Files {
515
516
  export {
517
+ type RerankConfig as RerankConfig,
516
518
  type ScoredVectorStoreFile as ScoredVectorStoreFile,
519
+ type VectorStoreFileStatus as VectorStoreFileStatus,
517
520
  type VectorStoreFile as VectorStoreFile,
518
521
  type FileDeleteResponse as FileDeleteResponse,
519
522
  type FileSearchResponse as FileSearchResponse,
@@ -2,7 +2,9 @@
2
2
 
3
3
  export {
4
4
  Files,
5
+ type RerankConfig,
5
6
  type ScoredVectorStoreFile,
7
+ type VectorStoreFileStatus,
6
8
  type VectorStoreFile,
7
9
  type FileDeleteResponse,
8
10
  type FileSearchResponse,
@@ -12,8 +12,10 @@ import {
12
12
  FileSearchParams,
13
13
  FileSearchResponse,
14
14
  Files,
15
+ RerankConfig,
15
16
  ScoredVectorStoreFile,
16
17
  VectorStoreFile,
18
+ VectorStoreFileStatus,
17
19
  VectorStoreFilesLimitOffset,
18
20
  } from './files';
19
21
  import { APIPromise } from '../../core/api-promise';
@@ -439,6 +441,11 @@ export interface VectorStore {
439
441
  */
440
442
  description?: string | null;
441
443
 
444
+ /**
445
+ * Whether the vector store can be accessed by anyone with valid login credentials
446
+ */
447
+ is_public?: boolean;
448
+
442
449
  /**
443
450
  * Additional metadata associated with the vector store
444
451
  */
@@ -544,7 +551,7 @@ export interface VectorStoreChunkSearchOptions {
544
551
  /**
545
552
  * Whether to rerank results and optional reranking configuration
546
553
  */
547
- rerank?: boolean | VectorStoreChunkSearchOptions.RerankConfig | null;
554
+ rerank?: boolean | FilesAPI.RerankConfig | null;
548
555
 
549
556
  /**
550
557
  * Whether to return file metadata
@@ -552,29 +559,6 @@ export interface VectorStoreChunkSearchOptions {
552
559
  return_metadata?: boolean;
553
560
  }
554
561
 
555
- export namespace VectorStoreChunkSearchOptions {
556
- /**
557
- * Represents a reranking configuration.
558
- */
559
- export interface RerankConfig {
560
- /**
561
- * The name of the reranking model
562
- */
563
- model?: string;
564
-
565
- /**
566
- * Whether to include metadata in the reranked results
567
- */
568
- with_metadata?: boolean | Array<string>;
569
-
570
- /**
571
- * Maximum number of results to return after reranking. If None, returns all
572
- * reranked results.
573
- */
574
- top_k?: number | null;
575
- }
576
- }
577
-
578
562
  /**
579
563
  * Response model for vector store deletion.
580
564
  */
@@ -637,6 +621,11 @@ export interface VectorStoreCreateParams {
637
621
  */
638
622
  description?: string | null;
639
623
 
624
+ /**
625
+ * Whether the vector store can be accessed by anyone with valid login credentials
626
+ */
627
+ is_public?: boolean;
628
+
640
629
  /**
641
630
  * Represents an expiration policy for a vector store.
642
631
  */
@@ -664,6 +653,11 @@ export interface VectorStoreUpdateParams {
664
653
  */
665
654
  description?: string | null;
666
655
 
656
+ /**
657
+ * Whether the vector store can be accessed by anyone with valid login credentials
658
+ */
659
+ is_public?: boolean | null;
660
+
667
661
  /**
668
662
  * Represents an expiration policy for a vector store.
669
663
  */
@@ -816,7 +810,9 @@ export declare namespace VectorStores {
816
810
 
817
811
  export {
818
812
  Files as Files,
813
+ type RerankConfig as RerankConfig,
819
814
  type ScoredVectorStoreFile as ScoredVectorStoreFile,
815
+ type VectorStoreFileStatus as VectorStoreFileStatus,
820
816
  type VectorStoreFile as VectorStoreFile,
821
817
  type FileDeleteResponse as FileDeleteResponse,
822
818
  type FileSearchResponse as FileSearchResponse,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.7.2'; // x-release-please-version
1
+ export const VERSION = '0.9.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.7.2";
1
+ export declare const VERSION = "0.9.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.7.2";
1
+ export declare const VERSION = "0.9.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.7.2'; // x-release-please-version
4
+ exports.VERSION = '0.9.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.7.2'; // x-release-please-version
1
+ export const VERSION = '0.9.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map