@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.
- package/CHANGELOG.md +391 -0
- package/README.md +4 -4
- package/_shims/index.d.ts +2 -0
- package/_shims/index.js +5 -1
- package/_shims/index.mjs +5 -1
- package/core.d.ts +11 -0
- package/core.d.ts.map +1 -1
- package/core.js +5 -2
- package/core.js.map +1 -1
- package/core.mjs +6 -3
- package/core.mjs.map +1 -1
- package/index.d.mts +28 -7
- package/index.d.ts +28 -7
- package/index.d.ts.map +1 -1
- package/index.js +32 -8
- package/index.js.map +1 -1
- package/index.mjs +32 -8
- package/index.mjs.map +1 -1
- package/package.json +8 -29
- package/resources/embeddings.d.ts +45 -0
- package/resources/embeddings.d.ts.map +1 -0
- package/resources/embeddings.js +20 -0
- package/resources/embeddings.js.map +1 -0
- package/resources/embeddings.mjs +16 -0
- package/resources/embeddings.mjs.map +1 -0
- package/resources/extractions/content.d.ts +2 -2
- package/resources/extractions/content.d.ts.map +1 -1
- package/resources/extractions/jobs.d.ts +3 -3
- package/resources/extractions/jobs.d.ts.map +1 -1
- package/resources/extractions/schema.d.ts +5 -5
- package/resources/extractions/schema.d.ts.map +1 -1
- package/resources/extractions.d.ts +2 -0
- package/resources/extractions.d.ts.map +1 -0
- package/resources/extractions.js +19 -0
- package/resources/extractions.js.map +1 -0
- package/resources/extractions.mjs +3 -0
- package/resources/extractions.mjs.map +1 -0
- package/resources/index.d.ts +2 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/parsing/jobs.d.ts +8 -0
- 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.d.ts +2 -0
- package/resources/parsing.d.ts.map +1 -0
- package/resources/parsing.js +19 -0
- package/resources/parsing.js.map +1 -0
- package/resources/parsing.mjs +3 -0
- package/resources/parsing.mjs.map +1 -0
- package/resources/shared.d.ts +14 -0
- package/resources/shared.d.ts.map +1 -1
- package/resources/top-level.d.ts +174 -1
- package/resources/top-level.d.ts.map +1 -1
- package/resources/vector-stores/files.d.ts +12 -0
- package/resources/vector-stores/files.d.ts.map +1 -1
- package/resources/vector-stores/files.js.map +1 -1
- package/resources/vector-stores/files.mjs.map +1 -1
- package/resources/vector-stores/vector-stores.d.ts +4 -0
- 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/resources/vector-stores.d.ts +2 -0
- package/resources/vector-stores.d.ts.map +1 -0
- package/resources/vector-stores.js +19 -0
- package/resources/vector-stores.js.map +1 -0
- package/resources/vector-stores.mjs +3 -0
- package/resources/vector-stores.mjs.map +1 -0
- package/resources.d.ts +2 -0
- package/resources.d.ts.map +1 -0
- package/resources.js +18 -0
- package/resources.js.map +1 -0
- package/resources.mjs +2 -0
- package/resources.mjs.map +1 -0
- package/src/_shims/index.d.ts +2 -0
- package/src/_shims/index.js +5 -1
- package/src/_shims/index.mjs +5 -1
- package/src/core.ts +23 -4
- package/src/index.ts +72 -21
- package/src/resources/embeddings.ts +67 -0
- package/src/resources/extractions/content.ts +2 -2
- package/src/resources/extractions/jobs.ts +3 -3
- package/src/resources/extractions/schema.ts +5 -5
- package/src/resources/extractions.ts +3 -0
- package/src/resources/index.ts +10 -1
- package/src/resources/parsing/jobs.ts +10 -0
- package/src/resources/parsing.ts +3 -0
- package/src/resources/shared.ts +17 -0
- package/src/resources/top-level.ts +260 -1
- package/src/resources/vector-stores/files.ts +15 -0
- package/src/resources/vector-stores/vector-stores.ts +5 -0
- package/src/resources/vector-stores.ts +3 -0
- package/src/resources.ts +1 -0
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
package/src/core.ts
CHANGED
@@ -16,7 +16,12 @@ import {
|
|
16
16
|
type RequestInit,
|
17
17
|
type Response,
|
18
18
|
type HeadersInit,
|
19
|
+
init,
|
19
20
|
} from './_shims/index';
|
21
|
+
|
22
|
+
// try running side effects outside of _shims/index to workaround https://github.com/vercel/next.js/issues/76881
|
23
|
+
init();
|
24
|
+
|
20
25
|
export { type Response };
|
21
26
|
import { BlobLike, isBlobLike, isMultipartBody } from './uploads';
|
22
27
|
export {
|
@@ -28,6 +33,20 @@ export {
|
|
28
33
|
|
29
34
|
export type Fetch = (url: RequestInfo, init?: RequestInit) => Promise<Response>;
|
30
35
|
|
36
|
+
/**
|
37
|
+
* An alias to the builtin `Array` type so we can
|
38
|
+
* easily alias it in import statements if there are name clashes.
|
39
|
+
*/
|
40
|
+
type _Array<T> = Array<T>;
|
41
|
+
|
42
|
+
/**
|
43
|
+
* An alias to the builtin `Record` type so we can
|
44
|
+
* easily alias it in import statements if there are name clashes.
|
45
|
+
*/
|
46
|
+
type _Record<K extends keyof any, T> = Record<K, T>;
|
47
|
+
|
48
|
+
export type { _Array as Array, _Record as Record };
|
49
|
+
|
31
50
|
type PromiseOrValue<T> = T | Promise<T>;
|
32
51
|
|
33
52
|
type APIResponseProps = {
|
@@ -48,8 +67,8 @@ async function defaultParseResponse<T>(props: APIResponseProps): Promise<T> {
|
|
48
67
|
}
|
49
68
|
|
50
69
|
const contentType = response.headers.get('content-type');
|
51
|
-
const
|
52
|
-
|
70
|
+
const mediaType = contentType?.split(';')[0]?.trim();
|
71
|
+
const isJSON = mediaType?.includes('application/json') || mediaType?.endsWith('+json');
|
53
72
|
if (isJSON) {
|
54
73
|
const json = await response.json();
|
55
74
|
|
@@ -366,7 +385,7 @@ export abstract class APIClient {
|
|
366
385
|
getHeader(headers, 'x-stainless-timeout') === undefined &&
|
367
386
|
options.timeout
|
368
387
|
) {
|
369
|
-
reqHeaders['x-stainless-timeout'] = String(options.timeout);
|
388
|
+
reqHeaders['x-stainless-timeout'] = String(Math.trunc(options.timeout / 1000));
|
370
389
|
}
|
371
390
|
|
372
391
|
this.validateHeaders(reqHeaders, headers);
|
@@ -395,7 +414,7 @@ export abstract class APIClient {
|
|
395
414
|
!headers ? {}
|
396
415
|
: Symbol.iterator in headers ?
|
397
416
|
Object.fromEntries(Array.from(headers as Iterable<string[]>).map((header) => [...header]))
|
398
|
-
: { ...headers }
|
417
|
+
: { ...(headers as any as Record<string, string>) }
|
399
418
|
);
|
400
419
|
}
|
401
420
|
|
package/src/index.ts
CHANGED
@@ -8,7 +8,16 @@ import { type LimitOffsetParams, LimitOffsetResponse } from './pagination';
|
|
8
8
|
import * as Uploads from './uploads';
|
9
9
|
import * as API from './resources/index';
|
10
10
|
import * as TopLevelAPI from './resources/top-level';
|
11
|
-
import {
|
11
|
+
import {
|
12
|
+
EmbedParams,
|
13
|
+
Embedding,
|
14
|
+
EmbeddingCreateResponse,
|
15
|
+
InfoResponse,
|
16
|
+
MultiEncodingEmbedding,
|
17
|
+
RerankParams,
|
18
|
+
RerankResponse,
|
19
|
+
} from './resources/top-level';
|
20
|
+
import { EmbeddingCreateParams, Embeddings } from './resources/embeddings';
|
12
21
|
import {
|
13
22
|
FileCreateParams,
|
14
23
|
FileDeleteResponse,
|
@@ -40,7 +49,7 @@ import {
|
|
40
49
|
} from './resources/vector-stores/vector-stores';
|
41
50
|
|
42
51
|
const environments = {
|
43
|
-
production: 'https://api.mixedbread.
|
52
|
+
production: 'https://api.mixedbread.com',
|
44
53
|
local: 'http://127.0.0.1:8000',
|
45
54
|
};
|
46
55
|
type Environment = keyof typeof environments;
|
@@ -55,7 +64,7 @@ export interface ClientOptions {
|
|
55
64
|
* Specifies the environment to use for the API.
|
56
65
|
*
|
57
66
|
* Each environment maps to a different base URL:
|
58
|
-
* - `production` corresponds to `https://api.mixedbread.
|
67
|
+
* - `production` corresponds to `https://api.mixedbread.com`
|
59
68
|
* - `local` corresponds to `http://127.0.0.1:8000`
|
60
69
|
*/
|
61
70
|
environment?: Environment | undefined;
|
@@ -128,9 +137,9 @@ export class Mixedbread extends Core.APIClient {
|
|
128
137
|
/**
|
129
138
|
* API Client for interfacing with the Mixedbread API.
|
130
139
|
*
|
131
|
-
* @param {string | undefined} [opts.apiKey=process.env['
|
140
|
+
* @param {string | undefined} [opts.apiKey=process.env['MIXEDBREAD_API_KEY'] ?? undefined]
|
132
141
|
* @param {Environment} [opts.environment=production] - Specifies the environment URL to use for the API.
|
133
|
-
* @param {string} [opts.baseURL=process.env['MIXEDBREAD_BASE_URL'] ?? https://api.mixedbread.
|
142
|
+
* @param {string} [opts.baseURL=process.env['MIXEDBREAD_BASE_URL'] ?? https://api.mixedbread.com] - Override the default base URL for the API.
|
134
143
|
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
135
144
|
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
136
145
|
* @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
@@ -140,12 +149,12 @@ export class Mixedbread extends Core.APIClient {
|
|
140
149
|
*/
|
141
150
|
constructor({
|
142
151
|
baseURL = Core.readEnv('MIXEDBREAD_BASE_URL'),
|
143
|
-
apiKey = Core.readEnv('
|
152
|
+
apiKey = Core.readEnv('MIXEDBREAD_API_KEY'),
|
144
153
|
...opts
|
145
154
|
}: ClientOptions = {}) {
|
146
155
|
if (apiKey === undefined) {
|
147
156
|
throw new Errors.MixedbreadError(
|
148
|
-
"The
|
157
|
+
"The MIXEDBREAD_API_KEY environment variable is missing or empty; either provide it, or instantiate the Mixedbread client with an apiKey option, like new Mixedbread({ apiKey: 'My API Key' }).",
|
149
158
|
);
|
150
159
|
}
|
151
160
|
|
@@ -175,10 +184,26 @@ export class Mixedbread extends Core.APIClient {
|
|
175
184
|
this.apiKey = apiKey;
|
176
185
|
}
|
177
186
|
|
187
|
+
vectorStores: API.VectorStores = new API.VectorStores(this);
|
178
188
|
parsing: API.Parsing = new API.Parsing(this);
|
179
189
|
files: API.Files = new API.Files(this);
|
180
|
-
vectorStores: API.VectorStores = new API.VectorStores(this);
|
181
190
|
extractions: API.Extractions = new API.Extractions(this);
|
191
|
+
embeddings: API.Embeddings = new API.Embeddings(this);
|
192
|
+
|
193
|
+
/**
|
194
|
+
* Create embeddings for text or images using the specified model, encoding format,
|
195
|
+
* and normalization.
|
196
|
+
*
|
197
|
+
* Args: params: The parameters for creating embeddings.
|
198
|
+
*
|
199
|
+
* Returns: EmbeddingCreateResponse: The response containing the embeddings.
|
200
|
+
*/
|
201
|
+
embed(
|
202
|
+
body: TopLevelAPI.EmbedParams,
|
203
|
+
options?: Core.RequestOptions,
|
204
|
+
): Core.APIPromise<TopLevelAPI.EmbeddingCreateResponse> {
|
205
|
+
return this.post('/v1/embeddings', { body, ...options });
|
206
|
+
}
|
182
207
|
|
183
208
|
/**
|
184
209
|
* Returns service information, including name and version.
|
@@ -189,6 +214,20 @@ export class Mixedbread extends Core.APIClient {
|
|
189
214
|
return this.get('/', options);
|
190
215
|
}
|
191
216
|
|
217
|
+
/**
|
218
|
+
* Rerank different kind of documents for a given query.
|
219
|
+
*
|
220
|
+
* Args: params: RerankParams: The parameters for reranking.
|
221
|
+
*
|
222
|
+
* Returns: RerankResponse: The reranked documents for the input query.
|
223
|
+
*/
|
224
|
+
rerank(
|
225
|
+
body: TopLevelAPI.RerankParams,
|
226
|
+
options?: Core.RequestOptions,
|
227
|
+
): Core.APIPromise<TopLevelAPI.RerankResponse> {
|
228
|
+
return this.post('/v1/reranking', { body, ...options });
|
229
|
+
}
|
230
|
+
|
192
231
|
protected override defaultQuery(): Core.DefaultQuery | undefined {
|
193
232
|
return this._options.defaultQuery;
|
194
233
|
}
|
@@ -225,30 +264,27 @@ export class Mixedbread extends Core.APIClient {
|
|
225
264
|
static fileFromPath = Uploads.fileFromPath;
|
226
265
|
}
|
227
266
|
|
267
|
+
Mixedbread.VectorStores = VectorStores;
|
268
|
+
Mixedbread.VectorStoresLimitOffset = VectorStoresLimitOffset;
|
228
269
|
Mixedbread.Parsing = Parsing;
|
229
270
|
Mixedbread.Files = Files;
|
230
271
|
Mixedbread.FileObjectsLimitOffset = FileObjectsLimitOffset;
|
231
|
-
Mixedbread.VectorStores = VectorStores;
|
232
|
-
Mixedbread.VectorStoresLimitOffset = VectorStoresLimitOffset;
|
233
272
|
Mixedbread.Extractions = Extractions;
|
273
|
+
Mixedbread.Embeddings = Embeddings;
|
234
274
|
export declare namespace Mixedbread {
|
235
275
|
export type RequestOptions = Core.RequestOptions;
|
236
276
|
|
237
277
|
export import LimitOffset = Pagination.LimitOffset;
|
238
278
|
export { type LimitOffsetParams as LimitOffsetParams, type LimitOffsetResponse as LimitOffsetResponse };
|
239
279
|
|
240
|
-
export { type InfoResponse as InfoResponse };
|
241
|
-
|
242
|
-
export { Parsing as Parsing };
|
243
|
-
|
244
280
|
export {
|
245
|
-
|
246
|
-
type
|
247
|
-
type
|
248
|
-
|
249
|
-
type
|
250
|
-
type
|
251
|
-
type
|
281
|
+
type Embedding as Embedding,
|
282
|
+
type EmbeddingCreateResponse as EmbeddingCreateResponse,
|
283
|
+
type MultiEncodingEmbedding as MultiEncodingEmbedding,
|
284
|
+
type InfoResponse as InfoResponse,
|
285
|
+
type RerankResponse as RerankResponse,
|
286
|
+
type EmbedParams as EmbedParams,
|
287
|
+
type RerankParams as RerankParams,
|
252
288
|
};
|
253
289
|
|
254
290
|
export {
|
@@ -270,10 +306,25 @@ export declare namespace Mixedbread {
|
|
270
306
|
type VectorStoreSearchParams as VectorStoreSearchParams,
|
271
307
|
};
|
272
308
|
|
309
|
+
export { Parsing as Parsing };
|
310
|
+
|
311
|
+
export {
|
312
|
+
Files as Files,
|
313
|
+
type FileObject as FileObject,
|
314
|
+
type FileDeleteResponse as FileDeleteResponse,
|
315
|
+
FileObjectsLimitOffset as FileObjectsLimitOffset,
|
316
|
+
type FileCreateParams as FileCreateParams,
|
317
|
+
type FileUpdateParams as FileUpdateParams,
|
318
|
+
type FileListParams as FileListParams,
|
319
|
+
};
|
320
|
+
|
273
321
|
export { Extractions as Extractions };
|
274
322
|
|
323
|
+
export { Embeddings as Embeddings, type EmbeddingCreateParams as EmbeddingCreateParams };
|
324
|
+
|
275
325
|
export type SearchFilter = API.SearchFilter;
|
276
326
|
export type SearchFilterCondition = API.SearchFilterCondition;
|
327
|
+
export type Usage = API.Usage;
|
277
328
|
}
|
278
329
|
|
279
330
|
export { toFile, fileFromPath } from './uploads';
|
@@ -0,0 +1,67 @@
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
import { APIResource } from '../resource';
|
4
|
+
import * as Core from '../core';
|
5
|
+
import * as TopLevelAPI from './top-level';
|
6
|
+
|
7
|
+
export class Embeddings extends APIResource {
|
8
|
+
/**
|
9
|
+
* Create embeddings for text or images using the specified model, encoding format,
|
10
|
+
* and normalization.
|
11
|
+
*
|
12
|
+
* Args: params: The parameters for creating embeddings.
|
13
|
+
*
|
14
|
+
* Returns: EmbeddingCreateResponse: The response containing the embeddings.
|
15
|
+
*/
|
16
|
+
create(
|
17
|
+
body: EmbeddingCreateParams,
|
18
|
+
options?: Core.RequestOptions,
|
19
|
+
): Core.APIPromise<TopLevelAPI.EmbeddingCreateResponse> {
|
20
|
+
return this._client.post('/v1/embeddings', { body, ...options });
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
export interface EmbeddingCreateParams {
|
25
|
+
/**
|
26
|
+
* The model to use for creating embeddings.
|
27
|
+
*/
|
28
|
+
model: string;
|
29
|
+
|
30
|
+
/**
|
31
|
+
* The input to create embeddings for.
|
32
|
+
*/
|
33
|
+
input: string | Array<string>;
|
34
|
+
|
35
|
+
/**
|
36
|
+
* The number of dimensions to use for the embeddings.
|
37
|
+
*/
|
38
|
+
dimensions?: number | null;
|
39
|
+
|
40
|
+
/**
|
41
|
+
* The prompt to use for the embedding creation.
|
42
|
+
*/
|
43
|
+
prompt?: string | null;
|
44
|
+
|
45
|
+
/**
|
46
|
+
* Whether to normalize the embeddings.
|
47
|
+
*/
|
48
|
+
normalized?: boolean;
|
49
|
+
|
50
|
+
/**
|
51
|
+
* The encoding format(s) of the embeddings. Can be a single format or a list of
|
52
|
+
* formats.
|
53
|
+
*/
|
54
|
+
encoding_format?:
|
55
|
+
| 'float'
|
56
|
+
| 'float16'
|
57
|
+
| 'base64'
|
58
|
+
| 'binary'
|
59
|
+
| 'ubinary'
|
60
|
+
| 'int8'
|
61
|
+
| 'uint8'
|
62
|
+
| Array<'float' | 'float16' | 'base64' | 'binary' | 'ubinary' | 'int8' | 'uint8'>;
|
63
|
+
}
|
64
|
+
|
65
|
+
export declare namespace Embeddings {
|
66
|
+
export { type EmbeddingCreateParams as EmbeddingCreateParams };
|
67
|
+
}
|
@@ -20,7 +20,7 @@ export class Content extends APIResource {
|
|
20
20
|
* The result of an extraction job.
|
21
21
|
*/
|
22
22
|
export interface ExtractionResult {
|
23
|
-
data: unknown
|
23
|
+
data: Record<string, unknown>;
|
24
24
|
|
25
25
|
warnings: Array<string>;
|
26
26
|
}
|
@@ -34,7 +34,7 @@ export interface ContentCreateParams {
|
|
34
34
|
/**
|
35
35
|
* The JSON schema to use for extraction
|
36
36
|
*/
|
37
|
-
json_schema: unknown
|
37
|
+
json_schema: Record<string, unknown>;
|
38
38
|
}
|
39
39
|
|
40
40
|
export declare namespace Content {
|
@@ -80,12 +80,12 @@ export interface ExtractionJob {
|
|
80
80
|
/**
|
81
81
|
* Error information if failed
|
82
82
|
*/
|
83
|
-
error: unknown | null;
|
83
|
+
error: Record<string, unknown> | null;
|
84
84
|
|
85
85
|
/**
|
86
86
|
* The JSON schema used for extraction
|
87
87
|
*/
|
88
|
-
json_schema: unknown
|
88
|
+
json_schema: Record<string, unknown>;
|
89
89
|
}
|
90
90
|
|
91
91
|
export interface JobCreateParams {
|
@@ -97,7 +97,7 @@ export interface JobCreateParams {
|
|
97
97
|
/**
|
98
98
|
* The JSON schema to use for extraction
|
99
99
|
*/
|
100
|
-
json_schema: unknown
|
100
|
+
json_schema: Record<string, unknown>;
|
101
101
|
}
|
102
102
|
|
103
103
|
export declare namespace Jobs {
|
@@ -45,7 +45,7 @@ export interface CreatedJsonSchema {
|
|
45
45
|
/**
|
46
46
|
* The created JSON schema
|
47
47
|
*/
|
48
|
-
json_schema: unknown
|
48
|
+
json_schema: Record<string, unknown>;
|
49
49
|
}
|
50
50
|
|
51
51
|
/**
|
@@ -55,7 +55,7 @@ export interface EnhancedJsonSchema {
|
|
55
55
|
/**
|
56
56
|
* The enhanced JSON schema
|
57
57
|
*/
|
58
|
-
json_schema: unknown
|
58
|
+
json_schema: Record<string, unknown>;
|
59
59
|
}
|
60
60
|
|
61
61
|
/**
|
@@ -75,7 +75,7 @@ export interface ValidatedJsonSchema {
|
|
75
75
|
/**
|
76
76
|
* The validated JSON schema
|
77
77
|
*/
|
78
|
-
json_schema: unknown
|
78
|
+
json_schema: Record<string, unknown>;
|
79
79
|
}
|
80
80
|
|
81
81
|
export interface SchemaCreateParams {
|
@@ -89,14 +89,14 @@ export interface SchemaEnhanceParams {
|
|
89
89
|
/**
|
90
90
|
* The JSON schema to enhance
|
91
91
|
*/
|
92
|
-
json_schema: unknown
|
92
|
+
json_schema: Record<string, unknown>;
|
93
93
|
}
|
94
94
|
|
95
95
|
export interface SchemaValidateParams {
|
96
96
|
/**
|
97
97
|
* The JSON schema to validate
|
98
98
|
*/
|
99
|
-
json_schema: unknown
|
99
|
+
json_schema: Record<string, unknown>;
|
100
100
|
}
|
101
101
|
|
102
102
|
export declare namespace Schema {
|
package/src/resources/index.ts
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
2
|
|
3
3
|
export * from './shared';
|
4
|
+
export { Embeddings, type EmbeddingCreateParams } from './embeddings';
|
4
5
|
export { Extractions } from './extractions/extractions';
|
5
6
|
export {
|
6
7
|
FileObjectsLimitOffset,
|
@@ -30,4 +31,12 @@ export {
|
|
30
31
|
type VectorStoreQuestionAnsweringParams,
|
31
32
|
type VectorStoreSearchParams,
|
32
33
|
} from './vector-stores/vector-stores';
|
33
|
-
export {
|
34
|
+
export {
|
35
|
+
type Embedding,
|
36
|
+
type EmbeddingCreateResponse,
|
37
|
+
type MultiEncodingEmbedding,
|
38
|
+
type InfoResponse,
|
39
|
+
type RerankResponse,
|
40
|
+
type EmbedParams,
|
41
|
+
type RerankParams,
|
42
|
+
} from './top-level';
|
@@ -178,6 +178,11 @@ export interface ParsingJob {
|
|
178
178
|
*/
|
179
179
|
id: string;
|
180
180
|
|
181
|
+
/**
|
182
|
+
* The ID of the file to parse
|
183
|
+
*/
|
184
|
+
file_id: string;
|
185
|
+
|
181
186
|
/**
|
182
187
|
* The status of the job
|
183
188
|
*/
|
@@ -342,6 +347,11 @@ export interface JobListResponse {
|
|
342
347
|
*/
|
343
348
|
id: string;
|
344
349
|
|
350
|
+
/**
|
351
|
+
* The ID of the file to parse
|
352
|
+
*/
|
353
|
+
file_id: string;
|
354
|
+
|
345
355
|
/**
|
346
356
|
* The status of the job
|
347
357
|
*/
|
package/src/resources/shared.ts
CHANGED
@@ -39,3 +39,20 @@ export interface SearchFilterCondition {
|
|
39
39
|
*/
|
40
40
|
operator: 'eq' | 'not_eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'not_in' | 'like' | 'not_like';
|
41
41
|
}
|
42
|
+
|
43
|
+
export interface Usage {
|
44
|
+
/**
|
45
|
+
* The number of tokens used for the prompt
|
46
|
+
*/
|
47
|
+
prompt_tokens: number;
|
48
|
+
|
49
|
+
/**
|
50
|
+
* The total number of tokens used
|
51
|
+
*/
|
52
|
+
total_tokens: number;
|
53
|
+
|
54
|
+
/**
|
55
|
+
* The number of tokens used for the completion
|
56
|
+
*/
|
57
|
+
completion_tokens?: number | null;
|
58
|
+
}
|