@mixedbread/sdk 0.1.0-alpha.9 → 0.2.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 (103) hide show
  1. package/CHANGELOG.md +391 -0
  2. package/README.md +4 -4
  3. package/_shims/index.d.ts +2 -0
  4. package/_shims/index.js +5 -1
  5. package/_shims/index.mjs +5 -1
  6. package/core.d.ts +11 -0
  7. package/core.d.ts.map +1 -1
  8. package/core.js +5 -2
  9. package/core.js.map +1 -1
  10. package/core.mjs +6 -3
  11. package/core.mjs.map +1 -1
  12. package/index.d.mts +28 -7
  13. package/index.d.ts +28 -7
  14. package/index.d.ts.map +1 -1
  15. package/index.js +32 -8
  16. package/index.js.map +1 -1
  17. package/index.mjs +32 -8
  18. package/index.mjs.map +1 -1
  19. package/package.json +8 -29
  20. package/resources/embeddings.d.ts +45 -0
  21. package/resources/embeddings.d.ts.map +1 -0
  22. package/resources/embeddings.js +20 -0
  23. package/resources/embeddings.js.map +1 -0
  24. package/resources/embeddings.mjs +16 -0
  25. package/resources/embeddings.mjs.map +1 -0
  26. package/resources/extractions/content.d.ts +2 -2
  27. package/resources/extractions/content.d.ts.map +1 -1
  28. package/resources/extractions/jobs.d.ts +3 -3
  29. package/resources/extractions/jobs.d.ts.map +1 -1
  30. package/resources/extractions/schema.d.ts +5 -5
  31. package/resources/extractions/schema.d.ts.map +1 -1
  32. package/resources/extractions.d.ts +2 -0
  33. package/resources/extractions.d.ts.map +1 -0
  34. package/resources/extractions.js +19 -0
  35. package/resources/extractions.js.map +1 -0
  36. package/resources/extractions.mjs +3 -0
  37. package/resources/extractions.mjs.map +1 -0
  38. package/resources/index.d.ts +2 -1
  39. package/resources/index.d.ts.map +1 -1
  40. package/resources/index.js +3 -1
  41. package/resources/index.js.map +1 -1
  42. package/resources/index.mjs +1 -0
  43. package/resources/index.mjs.map +1 -1
  44. package/resources/parsing/jobs.d.ts +8 -0
  45. package/resources/parsing/jobs.d.ts.map +1 -1
  46. package/resources/parsing/jobs.js.map +1 -1
  47. package/resources/parsing/jobs.mjs.map +1 -1
  48. package/resources/parsing.d.ts +2 -0
  49. package/resources/parsing.d.ts.map +1 -0
  50. package/resources/parsing.js +19 -0
  51. package/resources/parsing.js.map +1 -0
  52. package/resources/parsing.mjs +3 -0
  53. package/resources/parsing.mjs.map +1 -0
  54. package/resources/shared.d.ts +14 -0
  55. package/resources/shared.d.ts.map +1 -1
  56. package/resources/top-level.d.ts +174 -1
  57. package/resources/top-level.d.ts.map +1 -1
  58. package/resources/vector-stores/files.d.ts +12 -0
  59. package/resources/vector-stores/files.d.ts.map +1 -1
  60. package/resources/vector-stores/files.js.map +1 -1
  61. package/resources/vector-stores/files.mjs.map +1 -1
  62. package/resources/vector-stores/vector-stores.d.ts +4 -0
  63. package/resources/vector-stores/vector-stores.d.ts.map +1 -1
  64. package/resources/vector-stores/vector-stores.js.map +1 -1
  65. package/resources/vector-stores/vector-stores.mjs.map +1 -1
  66. package/resources/vector-stores.d.ts +2 -0
  67. package/resources/vector-stores.d.ts.map +1 -0
  68. package/resources/vector-stores.js +19 -0
  69. package/resources/vector-stores.js.map +1 -0
  70. package/resources/vector-stores.mjs +3 -0
  71. package/resources/vector-stores.mjs.map +1 -0
  72. package/resources.d.ts +2 -0
  73. package/resources.d.ts.map +1 -0
  74. package/resources.js +18 -0
  75. package/resources.js.map +1 -0
  76. package/resources.mjs +2 -0
  77. package/resources.mjs.map +1 -0
  78. package/src/_shims/index.d.ts +2 -0
  79. package/src/_shims/index.js +5 -1
  80. package/src/_shims/index.mjs +5 -1
  81. package/src/core.ts +23 -4
  82. package/src/index.ts +72 -21
  83. package/src/resources/embeddings.ts +67 -0
  84. package/src/resources/extractions/content.ts +2 -2
  85. package/src/resources/extractions/jobs.ts +3 -3
  86. package/src/resources/extractions/schema.ts +5 -5
  87. package/src/resources/extractions.ts +3 -0
  88. package/src/resources/index.ts +10 -1
  89. package/src/resources/parsing/jobs.ts +10 -0
  90. package/src/resources/parsing.ts +3 -0
  91. package/src/resources/shared.ts +17 -0
  92. package/src/resources/top-level.ts +260 -1
  93. package/src/resources/vector-stores/files.ts +15 -0
  94. package/src/resources/vector-stores/vector-stores.ts +5 -0
  95. package/src/resources/vector-stores.ts +3 -0
  96. package/src/resources.ts +1 -0
  97. package/src/version.ts +1 -1
  98. package/version.d.ts +1 -1
  99. package/version.d.ts.map +1 -1
  100. package/version.js +1 -1
  101. package/version.js.map +1 -1
  102. package/version.mjs +1 -1
  103. package/version.mjs.map +1 -1
@@ -1,5 +1,117 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
+ import * as Shared from './shared';
4
+
5
+ export interface Embedding {
6
+ /**
7
+ * The encoded embedding.
8
+ */
9
+ embedding: Array<number> | Array<number> | string;
10
+
11
+ /**
12
+ * The index of the embedding.
13
+ */
14
+ index: number;
15
+
16
+ /**
17
+ * The object type of the embedding.
18
+ */
19
+ object?: 'embedding';
20
+ }
21
+
22
+ export interface EmbeddingCreateResponse {
23
+ /**
24
+ * The usage of the model
25
+ */
26
+ usage: Shared.Usage;
27
+
28
+ /**
29
+ * The model used
30
+ */
31
+ model: string;
32
+
33
+ /**
34
+ * The created embeddings.
35
+ */
36
+ data: Array<Embedding> | Array<MultiEncodingEmbedding>;
37
+
38
+ /**
39
+ * The object type of the response
40
+ */
41
+ object?:
42
+ | 'list'
43
+ | 'parsing_job'
44
+ | 'job'
45
+ | 'embedding'
46
+ | 'embedding_dict'
47
+ | 'rank_result'
48
+ | 'file'
49
+ | 'vector_store'
50
+ | 'vector_store.file'
51
+ | 'api_key';
52
+
53
+ /**
54
+ * Whether the embeddings are normalized.
55
+ */
56
+ normalized: boolean;
57
+
58
+ /**
59
+ * The encoding formats of the embeddings.
60
+ */
61
+ encoding_format:
62
+ | 'float'
63
+ | 'float16'
64
+ | 'base64'
65
+ | 'binary'
66
+ | 'ubinary'
67
+ | 'int8'
68
+ | 'uint8'
69
+ | Array<'float' | 'float16' | 'base64' | 'binary' | 'ubinary' | 'int8' | 'uint8'>;
70
+
71
+ /**
72
+ * The number of dimensions used for the embeddings.
73
+ */
74
+ dimensions: number | null;
75
+ }
76
+
77
+ export interface MultiEncodingEmbedding {
78
+ /**
79
+ * The encoded embedding data by encoding format.Returned, if more than one
80
+ * encoding format is used.
81
+ */
82
+ embedding: MultiEncodingEmbedding.Embedding;
83
+
84
+ /**
85
+ * The index of the embedding.
86
+ */
87
+ index: number;
88
+
89
+ /**
90
+ * The object type of the embedding.
91
+ */
92
+ object?: 'embedding_dict';
93
+ }
94
+
95
+ export namespace MultiEncodingEmbedding {
96
+ /**
97
+ * The encoded embedding data by encoding format.Returned, if more than one
98
+ * encoding format is used.
99
+ */
100
+ export interface Embedding {
101
+ float?: Array<number>;
102
+
103
+ int8?: Array<number>;
104
+
105
+ uint8?: Array<number>;
106
+
107
+ binary?: Array<number>;
108
+
109
+ ubinary?: Array<number>;
110
+
111
+ base64?: string;
112
+ }
113
+ }
114
+
3
115
  /**
4
116
  * Info Pydantic Response Service Message
5
117
  */
@@ -9,6 +121,153 @@ export interface InfoResponse {
9
121
  version: string;
10
122
  }
11
123
 
124
+ export interface RerankResponse {
125
+ /**
126
+ * The usage of the model
127
+ */
128
+ usage: Shared.Usage;
129
+
130
+ /**
131
+ * The model used
132
+ */
133
+ model: string;
134
+
135
+ /**
136
+ * The ranked documents.
137
+ */
138
+ data: Array<RerankResponse.Data>;
139
+
140
+ /**
141
+ * The object type of the response
142
+ */
143
+ object?:
144
+ | 'list'
145
+ | 'parsing_job'
146
+ | 'job'
147
+ | 'embedding'
148
+ | 'embedding_dict'
149
+ | 'rank_result'
150
+ | 'file'
151
+ | 'vector_store'
152
+ | 'vector_store.file'
153
+ | 'api_key';
154
+
155
+ /**
156
+ * The number of documents to return.
157
+ */
158
+ top_k: number;
159
+
160
+ /**
161
+ * Whether to return the documents.
162
+ */
163
+ return_input: boolean;
164
+ }
165
+
166
+ export namespace RerankResponse {
167
+ export interface Data {
168
+ /**
169
+ * The index of the document.
170
+ */
171
+ index: number;
172
+
173
+ /**
174
+ * The score of the document.
175
+ */
176
+ score: number;
177
+
178
+ /**
179
+ * The input document.
180
+ */
181
+ input?: unknown;
182
+
183
+ /**
184
+ * The object type.
185
+ */
186
+ object?: 'rank_result';
187
+ }
188
+ }
189
+
190
+ export interface EmbedParams {
191
+ /**
192
+ * The model to use for creating embeddings.
193
+ */
194
+ model: string;
195
+
196
+ /**
197
+ * The input to create embeddings for.
198
+ */
199
+ input: string | Array<string>;
200
+
201
+ /**
202
+ * The number of dimensions to use for the embeddings.
203
+ */
204
+ dimensions?: number | null;
205
+
206
+ /**
207
+ * The prompt to use for the embedding creation.
208
+ */
209
+ prompt?: string | null;
210
+
211
+ /**
212
+ * Whether to normalize the embeddings.
213
+ */
214
+ normalized?: boolean;
215
+
216
+ /**
217
+ * The encoding format(s) of the embeddings. Can be a single format or a list of
218
+ * formats.
219
+ */
220
+ encoding_format?:
221
+ | 'float'
222
+ | 'float16'
223
+ | 'base64'
224
+ | 'binary'
225
+ | 'ubinary'
226
+ | 'int8'
227
+ | 'uint8'
228
+ | Array<'float' | 'float16' | 'base64' | 'binary' | 'ubinary' | 'int8' | 'uint8'>;
229
+ }
230
+
231
+ export interface RerankParams {
232
+ /**
233
+ * The model to use for reranking documents.
234
+ */
235
+ model?: string;
236
+
237
+ /**
238
+ * The query to rerank the documents.
239
+ */
240
+ query: string;
241
+
242
+ /**
243
+ * The input documents to rerank.
244
+ */
245
+ input: Array<string | unknown | Array<unknown>>;
246
+
247
+ /**
248
+ * The fields of the documents to rank.
249
+ */
250
+ rank_fields?: Array<string> | null;
251
+
252
+ /**
253
+ * The number of documents to return.
254
+ */
255
+ top_k?: number;
256
+
257
+ /**
258
+ * Whether to return the documents.
259
+ */
260
+ return_input?: boolean;
261
+ }
262
+
12
263
  export declare namespace TopLevel {
13
- export { type InfoResponse as InfoResponse };
264
+ export {
265
+ type Embedding as Embedding,
266
+ type EmbeddingCreateResponse as EmbeddingCreateResponse,
267
+ type MultiEncodingEmbedding as MultiEncodingEmbedding,
268
+ type InfoResponse as InfoResponse,
269
+ type RerankResponse as RerankResponse,
270
+ type EmbedParams as EmbedParams,
271
+ type RerankParams as RerankParams,
272
+ };
14
273
  }
@@ -223,6 +223,11 @@ export interface ScoredVectorStoreFile {
223
223
  */
224
224
  id: string;
225
225
 
226
+ /**
227
+ * Name of the file
228
+ */
229
+ filename?: string;
230
+
226
231
  /**
227
232
  * Optional file metadata
228
233
  */
@@ -283,6 +288,11 @@ export interface VectorStoreFile {
283
288
  */
284
289
  id: string;
285
290
 
291
+ /**
292
+ * Name of the file
293
+ */
294
+ filename?: string;
295
+
286
296
  /**
287
297
  * Optional file metadata
288
298
  */
@@ -382,6 +392,11 @@ export namespace FileCreateParams {
382
392
  * Strategy for adding the file
383
393
  */
384
394
  parsing_strategy?: 'fast' | 'high_quality';
395
+
396
+ /**
397
+ * Whether to contextualize the file
398
+ */
399
+ contextualization?: boolean;
385
400
  }
386
401
  }
387
402
 
@@ -207,6 +207,11 @@ export interface ScoredVectorStoreChunk {
207
207
  */
208
208
  file_id: string;
209
209
 
210
+ /**
211
+ * filename
212
+ */
213
+ filename: string;
214
+
210
215
  /**
211
216
  * vector store id
212
217
  */
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './vector-stores/index';
@@ -0,0 +1 @@
1
+ export * from './resources/index';
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.1.0-alpha.9'; // x-release-please-version
1
+ export const VERSION = '0.2.0'; // x-release-please-version
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.1.0-alpha.9";
1
+ export declare const VERSION = "0.2.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,kBAAkB,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
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.1.0-alpha.9'; // x-release-please-version
4
+ exports.VERSION = '0.2.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,eAAe,CAAC,CAAC,2BAA2B"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,OAAO,CAAC,CAAC,2BAA2B"}
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.1.0-alpha.9'; // x-release-please-version
1
+ export const VERSION = '0.2.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map
package/version.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC,CAAC,2BAA2B"}
1
+ {"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,2BAA2B"}