@mixedbread/sdk 0.1.0-alpha.19 → 0.1.0-alpha.20
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 +11 -0
- package/README.md +36 -51
- package/index.d.mts +10 -11
- package/index.d.ts +10 -11
- package/index.d.ts.map +1 -1
- package/index.js +8 -8
- package/index.js.map +1 -1
- package/index.mjs +8 -8
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/embeddings.d.ts +3 -94
- package/resources/embeddings.d.ts.map +1 -1
- package/resources/embeddings.js.map +1 -1
- package/resources/embeddings.mjs.map +1 -1
- package/resources/index.d.ts +2 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/top-level.d.ts +94 -2
- package/resources/top-level.d.ts.map +1 -1
- package/src/index.ts +35 -38
- package/src/resources/embeddings.ts +3 -141
- package/src/resources/index.ts +10 -7
- package/src/resources/top-level.ts +136 -1
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/resources/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAEA,cAAc,UAAU,CAAC;AACzB,OAAO,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAEA,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,KAAK,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EACL,sBAAsB,EACtB,KAAK,EACL,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,cAAc,GACpB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EACL,uBAAuB,EACvB,YAAY,EACZ,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,sBAAsB,EAC3B,KAAK,WAAW,EAChB,KAAK,6BAA6B,EAClC,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,EAC9B,KAAK,oCAAoC,EACzC,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,kCAAkC,EACvC,KAAK,uBAAuB,GAC7B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,KAAK,EAAE,EACP,KAAK,SAAS,EACd,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,YAAY,GAClB,MAAM,aAAa,CAAC"}
|
package/resources/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;AAEtF,8CAAyB;AACzB,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;AAEtF,8CAAyB;AACzB,8CAAsE;AAA7D,wGAAA,UAAU,OAAA;AACnB,4DAAwD;AAA/C,0GAAA,WAAW,OAAA;AACpB,oCAQiB;AAPf,+GAAA,sBAAsB,OAAA;AACtB,8FAAA,KAAK,OAAA;AAOP,gDAA4C;AAAnC,kGAAA,OAAO,OAAA;AAChB,kEAiBuC;AAhBrC,wHAAA,uBAAuB,OAAA;AACvB,6GAAA,YAAY,OAAA"}
|
package/resources/index.mjs
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
2
|
export * from "./shared.mjs";
|
3
|
-
export { Embeddings
|
3
|
+
export { Embeddings } from "./embeddings.mjs";
|
4
4
|
export { Extractions } from "./extractions/extractions.mjs";
|
5
5
|
export { FileObjectsLimitOffset, Files, } from "./files.mjs";
|
6
6
|
export { Parsing } from "./parsing/parsing.mjs";
|
package/resources/index.mjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;;OAG/E,
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;;OAG/E,EAAE,UAAU,EAA8B;OAC1C,EAAE,WAAW,EAAE;OACf,EACL,sBAAsB,EACtB,KAAK,GAMN;OACM,EAAE,OAAO,EAAE;OACX,EACL,uBAAuB,EACvB,YAAY,GAeb"}
|
package/resources/top-level.d.ts
CHANGED
@@ -1,3 +1,95 @@
|
|
1
|
+
export interface Em {
|
2
|
+
/**
|
3
|
+
* The usage of the model
|
4
|
+
*/
|
5
|
+
usage: Em.Usage;
|
6
|
+
/**
|
7
|
+
* The model used
|
8
|
+
*/
|
9
|
+
model: string;
|
10
|
+
/**
|
11
|
+
* The created embeddings.
|
12
|
+
*/
|
13
|
+
data: Array<Embedding> | Array<MultiEncodingEmbedding>;
|
14
|
+
/**
|
15
|
+
* The object type of the response
|
16
|
+
*/
|
17
|
+
object?: 'list' | 'parsing_job' | 'job' | 'embedding' | 'embedding_dict' | 'rank_result' | 'file' | 'vector_store' | 'vector_store.file' | 'api_key';
|
18
|
+
/**
|
19
|
+
* Whether the embeddings are normalized.
|
20
|
+
*/
|
21
|
+
normalized: boolean;
|
22
|
+
/**
|
23
|
+
* The encoding formats of the embeddings.
|
24
|
+
*/
|
25
|
+
encoding_format: 'float' | 'float16' | 'base64' | 'binary' | 'ubinary' | 'int8' | 'uint8' | Array<'float' | 'float16' | 'base64' | 'binary' | 'ubinary' | 'int8' | 'uint8'>;
|
26
|
+
/**
|
27
|
+
* The number of dimensions used for the embeddings.
|
28
|
+
*/
|
29
|
+
dimensions: number | null;
|
30
|
+
}
|
31
|
+
export declare namespace Em {
|
32
|
+
/**
|
33
|
+
* The usage of the model
|
34
|
+
*/
|
35
|
+
interface Usage {
|
36
|
+
/**
|
37
|
+
* The number of tokens used for the prompt
|
38
|
+
*/
|
39
|
+
prompt_tokens: number;
|
40
|
+
/**
|
41
|
+
* The total number of tokens used
|
42
|
+
*/
|
43
|
+
total_tokens: number;
|
44
|
+
/**
|
45
|
+
* The number of tokens used for the completion
|
46
|
+
*/
|
47
|
+
completion_tokens?: number | null;
|
48
|
+
}
|
49
|
+
}
|
50
|
+
export interface Embedding {
|
51
|
+
/**
|
52
|
+
* The encoded embedding.
|
53
|
+
*/
|
54
|
+
embedding: Array<number> | Array<number> | string;
|
55
|
+
/**
|
56
|
+
* The index of the embedding.
|
57
|
+
*/
|
58
|
+
index: number;
|
59
|
+
/**
|
60
|
+
* The object type of the embedding.
|
61
|
+
*/
|
62
|
+
object?: 'embedding';
|
63
|
+
}
|
64
|
+
export interface MultiEncodingEmbedding {
|
65
|
+
/**
|
66
|
+
* The encoded embedding data by encoding format.Returned, if more than one
|
67
|
+
* encoding format is used.
|
68
|
+
*/
|
69
|
+
embedding: MultiEncodingEmbedding.Embedding;
|
70
|
+
/**
|
71
|
+
* The index of the embedding.
|
72
|
+
*/
|
73
|
+
index: number;
|
74
|
+
/**
|
75
|
+
* The object type of the embedding.
|
76
|
+
*/
|
77
|
+
object?: 'embedding_dict';
|
78
|
+
}
|
79
|
+
export declare namespace MultiEncodingEmbedding {
|
80
|
+
/**
|
81
|
+
* The encoded embedding data by encoding format.Returned, if more than one
|
82
|
+
* encoding format is used.
|
83
|
+
*/
|
84
|
+
interface Embedding {
|
85
|
+
float?: Array<number>;
|
86
|
+
int8?: Array<number>;
|
87
|
+
uint8?: Array<number>;
|
88
|
+
binary?: Array<number>;
|
89
|
+
ubinary?: Array<number>;
|
90
|
+
base64?: string;
|
91
|
+
}
|
92
|
+
}
|
1
93
|
/**
|
2
94
|
* Info Pydantic Response Service Message
|
3
95
|
*/
|
@@ -107,7 +199,7 @@ export interface RerankParams {
|
|
107
199
|
/**
|
108
200
|
* The input documents to rerank.
|
109
201
|
*/
|
110
|
-
input: Array<string | unknown
|
202
|
+
input: Array<string | unknown | Array<unknown>>;
|
111
203
|
/**
|
112
204
|
* The fields of the documents to rank.
|
113
205
|
*/
|
@@ -122,6 +214,6 @@ export interface RerankParams {
|
|
122
214
|
return_input?: boolean;
|
123
215
|
}
|
124
216
|
export declare namespace TopLevel {
|
125
|
-
export { type InfoResponse as InfoResponse, type RerankResponse as RerankResponse, type EmbedParams as EmbedParams, type RerankParams as RerankParams, };
|
217
|
+
export { type Em as Em, type Embedding as Embedding, type MultiEncodingEmbedding as MultiEncodingEmbedding, type InfoResponse as InfoResponse, type RerankResponse as RerankResponse, type EmbedParams as EmbedParams, type RerankParams as RerankParams, };
|
126
218
|
}
|
127
219
|
//# sourceMappingURL=top-level.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"top-level.d.ts","sourceRoot":"","sources":["../src/resources/top-level.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IAEb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC;IAE5B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAEjC;;OAEG;IACH,MAAM,CAAC,EACH,MAAM,GACN,aAAa,GACb,KAAK,GACL,WAAW,GACX,gBAAgB,GAChB,aAAa,GACb,MAAM,GACN,cAAc,GACd,mBAAmB,GACnB,SAAS,CAAC;IAEd;;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K,EAAE,IAAI,EAAE,EACb,KAAK,SAAS,IAAI,SAAS,EAC3B,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,YAAY,IAAI,YAAY,EACjC,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,YAAY,IAAI,YAAY,GAClC,CAAC;CACH"}
|
package/src/index.ts
CHANGED
@@ -6,16 +6,18 @@ import * as Errors from './error';
|
|
6
6
|
import * as Pagination from './pagination';
|
7
7
|
import { type LimitOffsetParams, LimitOffsetResponse } from './pagination';
|
8
8
|
import * as Uploads from './uploads';
|
9
|
-
import * as EmbeddingsAPI from './resources/embeddings';
|
10
|
-
import {
|
11
|
-
Embedding,
|
12
|
-
EmbeddingCreateParams,
|
13
|
-
EmbeddingCreateResponse,
|
14
|
-
Embeddings,
|
15
|
-
} from './resources/embeddings';
|
16
9
|
import * as API from './resources/index';
|
17
10
|
import * as TopLevelAPI from './resources/top-level';
|
18
|
-
import {
|
11
|
+
import {
|
12
|
+
Em,
|
13
|
+
EmbedParams,
|
14
|
+
Embedding,
|
15
|
+
InfoResponse,
|
16
|
+
MultiEncodingEmbedding,
|
17
|
+
RerankParams,
|
18
|
+
RerankResponse,
|
19
|
+
} from './resources/top-level';
|
20
|
+
import { EmbeddingCreateParams, Embeddings } from './resources/embeddings';
|
19
21
|
import {
|
20
22
|
FileCreateParams,
|
21
23
|
FileDeleteResponse,
|
@@ -182,11 +184,11 @@ export class Mixedbread extends Core.APIClient {
|
|
182
184
|
this.apiKey = apiKey;
|
183
185
|
}
|
184
186
|
|
185
|
-
|
187
|
+
vectorStores: API.VectorStores = new API.VectorStores(this);
|
186
188
|
parsing: API.Parsing = new API.Parsing(this);
|
187
189
|
files: API.Files = new API.Files(this);
|
188
|
-
vectorStores: API.VectorStores = new API.VectorStores(this);
|
189
190
|
extractions: API.Extractions = new API.Extractions(this);
|
191
|
+
embeddings: API.Embeddings = new API.Embeddings(this);
|
190
192
|
|
191
193
|
/**
|
192
194
|
* Create embeddings for text or images using the specified model, encoding format,
|
@@ -196,10 +198,7 @@ export class Mixedbread extends Core.APIClient {
|
|
196
198
|
*
|
197
199
|
* Returns: EmbeddingCreateResponse: The response containing the embeddings.
|
198
200
|
*/
|
199
|
-
embed(
|
200
|
-
body: TopLevelAPI.EmbedParams,
|
201
|
-
options?: Core.RequestOptions,
|
202
|
-
): Core.APIPromise<EmbeddingsAPI.EmbeddingCreateResponse> {
|
201
|
+
embed(body: TopLevelAPI.EmbedParams, options?: Core.RequestOptions): Core.APIPromise<TopLevelAPI.Em> {
|
203
202
|
return this.post('/v1/embeddings', { body, ...options });
|
204
203
|
}
|
205
204
|
|
@@ -215,9 +214,9 @@ export class Mixedbread extends Core.APIClient {
|
|
215
214
|
/**
|
216
215
|
* Rerank different kind of documents for a given query.
|
217
216
|
*
|
218
|
-
* Args: params:
|
217
|
+
* Args: params: RerankParams: The parameters for reranking.
|
219
218
|
*
|
220
|
-
* Returns:
|
219
|
+
* Returns: RerankResponse: The reranked documents for the input query.
|
221
220
|
*/
|
222
221
|
rerank(
|
223
222
|
body: TopLevelAPI.RerankParams,
|
@@ -262,13 +261,13 @@ export class Mixedbread extends Core.APIClient {
|
|
262
261
|
static fileFromPath = Uploads.fileFromPath;
|
263
262
|
}
|
264
263
|
|
265
|
-
Mixedbread.
|
264
|
+
Mixedbread.VectorStores = VectorStores;
|
265
|
+
Mixedbread.VectorStoresLimitOffset = VectorStoresLimitOffset;
|
266
266
|
Mixedbread.Parsing = Parsing;
|
267
267
|
Mixedbread.Files = Files;
|
268
268
|
Mixedbread.FileObjectsLimitOffset = FileObjectsLimitOffset;
|
269
|
-
Mixedbread.VectorStores = VectorStores;
|
270
|
-
Mixedbread.VectorStoresLimitOffset = VectorStoresLimitOffset;
|
271
269
|
Mixedbread.Extractions = Extractions;
|
270
|
+
Mixedbread.Embeddings = Embeddings;
|
272
271
|
export declare namespace Mixedbread {
|
273
272
|
export type RequestOptions = Core.RequestOptions;
|
274
273
|
|
@@ -276,31 +275,15 @@ export declare namespace Mixedbread {
|
|
276
275
|
export { type LimitOffsetParams as LimitOffsetParams, type LimitOffsetResponse as LimitOffsetResponse };
|
277
276
|
|
278
277
|
export {
|
278
|
+
type Em as Em,
|
279
|
+
type Embedding as Embedding,
|
280
|
+
type MultiEncodingEmbedding as MultiEncodingEmbedding,
|
279
281
|
type InfoResponse as InfoResponse,
|
280
282
|
type RerankResponse as RerankResponse,
|
281
283
|
type EmbedParams as EmbedParams,
|
282
284
|
type RerankParams as RerankParams,
|
283
285
|
};
|
284
286
|
|
285
|
-
export {
|
286
|
-
Embeddings as Embeddings,
|
287
|
-
type Embedding as Embedding,
|
288
|
-
type EmbeddingCreateResponse as EmbeddingCreateResponse,
|
289
|
-
type EmbeddingCreateParams as EmbeddingCreateParams,
|
290
|
-
};
|
291
|
-
|
292
|
-
export { Parsing as Parsing };
|
293
|
-
|
294
|
-
export {
|
295
|
-
Files as Files,
|
296
|
-
type FileObject as FileObject,
|
297
|
-
type FileDeleteResponse as FileDeleteResponse,
|
298
|
-
FileObjectsLimitOffset as FileObjectsLimitOffset,
|
299
|
-
type FileCreateParams as FileCreateParams,
|
300
|
-
type FileUpdateParams as FileUpdateParams,
|
301
|
-
type FileListParams as FileListParams,
|
302
|
-
};
|
303
|
-
|
304
287
|
export {
|
305
288
|
VectorStores as VectorStores,
|
306
289
|
type ExpiresAfter as ExpiresAfter,
|
@@ -320,8 +303,22 @@ export declare namespace Mixedbread {
|
|
320
303
|
type VectorStoreSearchParams as VectorStoreSearchParams,
|
321
304
|
};
|
322
305
|
|
306
|
+
export { Parsing as Parsing };
|
307
|
+
|
308
|
+
export {
|
309
|
+
Files as Files,
|
310
|
+
type FileObject as FileObject,
|
311
|
+
type FileDeleteResponse as FileDeleteResponse,
|
312
|
+
FileObjectsLimitOffset as FileObjectsLimitOffset,
|
313
|
+
type FileCreateParams as FileCreateParams,
|
314
|
+
type FileUpdateParams as FileUpdateParams,
|
315
|
+
type FileListParams as FileListParams,
|
316
|
+
};
|
317
|
+
|
323
318
|
export { Extractions as Extractions };
|
324
319
|
|
320
|
+
export { Embeddings as Embeddings, type EmbeddingCreateParams as EmbeddingCreateParams };
|
321
|
+
|
325
322
|
export type SearchFilter = API.SearchFilter;
|
326
323
|
export type SearchFilterCondition = API.SearchFilterCondition;
|
327
324
|
}
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
import { APIResource } from '../resource';
|
4
4
|
import * as Core from '../core';
|
5
|
+
import * as TopLevelAPI from './top-level';
|
5
6
|
|
6
7
|
export class Embeddings extends APIResource {
|
7
8
|
/**
|
@@ -12,146 +13,11 @@ export class Embeddings extends APIResource {
|
|
12
13
|
*
|
13
14
|
* Returns: EmbeddingCreateResponse: The response containing the embeddings.
|
14
15
|
*/
|
15
|
-
create(
|
16
|
-
body: EmbeddingCreateParams,
|
17
|
-
options?: Core.RequestOptions,
|
18
|
-
): Core.APIPromise<EmbeddingCreateResponse> {
|
16
|
+
create(body: EmbeddingCreateParams, options?: Core.RequestOptions): Core.APIPromise<TopLevelAPI.Em> {
|
19
17
|
return this._client.post('/v1/embeddings', { body, ...options });
|
20
18
|
}
|
21
19
|
}
|
22
20
|
|
23
|
-
export interface Embedding {
|
24
|
-
/**
|
25
|
-
* The encoded embedding.
|
26
|
-
*/
|
27
|
-
embedding: Array<number> | Array<number> | string;
|
28
|
-
|
29
|
-
/**
|
30
|
-
* The index of the embedding.
|
31
|
-
*/
|
32
|
-
index: number;
|
33
|
-
|
34
|
-
/**
|
35
|
-
* The object type of the embedding.
|
36
|
-
*/
|
37
|
-
object?: 'embedding';
|
38
|
-
}
|
39
|
-
|
40
|
-
export interface EmbeddingCreateResponse {
|
41
|
-
/**
|
42
|
-
* The usage of the model
|
43
|
-
*/
|
44
|
-
usage: EmbeddingCreateResponse.Usage;
|
45
|
-
|
46
|
-
/**
|
47
|
-
* The model used
|
48
|
-
*/
|
49
|
-
model: string;
|
50
|
-
|
51
|
-
/**
|
52
|
-
* The created embeddings.
|
53
|
-
*/
|
54
|
-
data: Array<Embedding> | Array<EmbeddingCreateResponse.UnionMember1>;
|
55
|
-
|
56
|
-
/**
|
57
|
-
* The object type of the response
|
58
|
-
*/
|
59
|
-
object?:
|
60
|
-
| 'list'
|
61
|
-
| 'parsing_job'
|
62
|
-
| 'job'
|
63
|
-
| 'embedding'
|
64
|
-
| 'embedding_dict'
|
65
|
-
| 'rank_result'
|
66
|
-
| 'file'
|
67
|
-
| 'vector_store'
|
68
|
-
| 'vector_store.file'
|
69
|
-
| 'api_key';
|
70
|
-
|
71
|
-
/**
|
72
|
-
* Whether the embeddings are normalized.
|
73
|
-
*/
|
74
|
-
normalized: boolean;
|
75
|
-
|
76
|
-
/**
|
77
|
-
* The encoding formats of the embeddings.
|
78
|
-
*/
|
79
|
-
encoding_format:
|
80
|
-
| 'float'
|
81
|
-
| 'float16'
|
82
|
-
| 'base64'
|
83
|
-
| 'binary'
|
84
|
-
| 'ubinary'
|
85
|
-
| 'int8'
|
86
|
-
| 'uint8'
|
87
|
-
| Array<'float' | 'float16' | 'base64' | 'binary' | 'ubinary' | 'int8' | 'uint8'>;
|
88
|
-
|
89
|
-
/**
|
90
|
-
* The number of dimensions used for the embeddings.
|
91
|
-
*/
|
92
|
-
dimensions: number | null;
|
93
|
-
}
|
94
|
-
|
95
|
-
export namespace EmbeddingCreateResponse {
|
96
|
-
/**
|
97
|
-
* The usage of the model
|
98
|
-
*/
|
99
|
-
export interface Usage {
|
100
|
-
/**
|
101
|
-
* The number of tokens used for the prompt
|
102
|
-
*/
|
103
|
-
prompt_tokens: number;
|
104
|
-
|
105
|
-
/**
|
106
|
-
* The total number of tokens used
|
107
|
-
*/
|
108
|
-
total_tokens: number;
|
109
|
-
|
110
|
-
/**
|
111
|
-
* The number of tokens used for the completion
|
112
|
-
*/
|
113
|
-
completion_tokens?: number | null;
|
114
|
-
}
|
115
|
-
|
116
|
-
export interface UnionMember1 {
|
117
|
-
/**
|
118
|
-
* The encoded embedding data by encoding format.Returned, if more than one
|
119
|
-
* encoding format is used.
|
120
|
-
*/
|
121
|
-
embedding: UnionMember1.Embedding;
|
122
|
-
|
123
|
-
/**
|
124
|
-
* The index of the embedding.
|
125
|
-
*/
|
126
|
-
index: number;
|
127
|
-
|
128
|
-
/**
|
129
|
-
* The object type of the embedding.
|
130
|
-
*/
|
131
|
-
object?: 'embedding_dict';
|
132
|
-
}
|
133
|
-
|
134
|
-
export namespace UnionMember1 {
|
135
|
-
/**
|
136
|
-
* The encoded embedding data by encoding format.Returned, if more than one
|
137
|
-
* encoding format is used.
|
138
|
-
*/
|
139
|
-
export interface Embedding {
|
140
|
-
float?: Array<number>;
|
141
|
-
|
142
|
-
int8?: Array<number>;
|
143
|
-
|
144
|
-
uint8?: Array<number>;
|
145
|
-
|
146
|
-
binary?: Array<number>;
|
147
|
-
|
148
|
-
ubinary?: Array<number>;
|
149
|
-
|
150
|
-
base64?: string;
|
151
|
-
}
|
152
|
-
}
|
153
|
-
}
|
154
|
-
|
155
21
|
export interface EmbeddingCreateParams {
|
156
22
|
/**
|
157
23
|
* The model to use for creating embeddings.
|
@@ -194,9 +60,5 @@ export interface EmbeddingCreateParams {
|
|
194
60
|
}
|
195
61
|
|
196
62
|
export declare namespace Embeddings {
|
197
|
-
export {
|
198
|
-
type Embedding as Embedding,
|
199
|
-
type EmbeddingCreateResponse as EmbeddingCreateResponse,
|
200
|
-
type EmbeddingCreateParams as EmbeddingCreateParams,
|
201
|
-
};
|
63
|
+
export { type EmbeddingCreateParams as EmbeddingCreateParams };
|
202
64
|
}
|
package/src/resources/index.ts
CHANGED
@@ -1,12 +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 {
|
5
|
-
Embeddings,
|
6
|
-
type Embedding,
|
7
|
-
type EmbeddingCreateResponse,
|
8
|
-
type EmbeddingCreateParams,
|
9
|
-
} from './embeddings';
|
4
|
+
export { Embeddings, type EmbeddingCreateParams } from './embeddings';
|
10
5
|
export { Extractions } from './extractions/extractions';
|
11
6
|
export {
|
12
7
|
FileObjectsLimitOffset,
|
@@ -36,4 +31,12 @@ export {
|
|
36
31
|
type VectorStoreQuestionAnsweringParams,
|
37
32
|
type VectorStoreSearchParams,
|
38
33
|
} from './vector-stores/vector-stores';
|
39
|
-
export {
|
34
|
+
export {
|
35
|
+
type Em,
|
36
|
+
type Embedding,
|
37
|
+
type MultiEncodingEmbedding,
|
38
|
+
type InfoResponse,
|
39
|
+
type RerankResponse,
|
40
|
+
type EmbedParams,
|
41
|
+
type RerankParams,
|
42
|
+
} from './top-level';
|
@@ -1,5 +1,137 @@
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
2
|
|
3
|
+
export interface Em {
|
4
|
+
/**
|
5
|
+
* The usage of the model
|
6
|
+
*/
|
7
|
+
usage: Em.Usage;
|
8
|
+
|
9
|
+
/**
|
10
|
+
* The model used
|
11
|
+
*/
|
12
|
+
model: string;
|
13
|
+
|
14
|
+
/**
|
15
|
+
* The created embeddings.
|
16
|
+
*/
|
17
|
+
data: Array<Embedding> | Array<MultiEncodingEmbedding>;
|
18
|
+
|
19
|
+
/**
|
20
|
+
* The object type of the response
|
21
|
+
*/
|
22
|
+
object?:
|
23
|
+
| 'list'
|
24
|
+
| 'parsing_job'
|
25
|
+
| 'job'
|
26
|
+
| 'embedding'
|
27
|
+
| 'embedding_dict'
|
28
|
+
| 'rank_result'
|
29
|
+
| 'file'
|
30
|
+
| 'vector_store'
|
31
|
+
| 'vector_store.file'
|
32
|
+
| 'api_key';
|
33
|
+
|
34
|
+
/**
|
35
|
+
* Whether the embeddings are normalized.
|
36
|
+
*/
|
37
|
+
normalized: boolean;
|
38
|
+
|
39
|
+
/**
|
40
|
+
* The encoding formats of the embeddings.
|
41
|
+
*/
|
42
|
+
encoding_format:
|
43
|
+
| 'float'
|
44
|
+
| 'float16'
|
45
|
+
| 'base64'
|
46
|
+
| 'binary'
|
47
|
+
| 'ubinary'
|
48
|
+
| 'int8'
|
49
|
+
| 'uint8'
|
50
|
+
| Array<'float' | 'float16' | 'base64' | 'binary' | 'ubinary' | 'int8' | 'uint8'>;
|
51
|
+
|
52
|
+
/**
|
53
|
+
* The number of dimensions used for the embeddings.
|
54
|
+
*/
|
55
|
+
dimensions: number | null;
|
56
|
+
}
|
57
|
+
|
58
|
+
export namespace Em {
|
59
|
+
/**
|
60
|
+
* The usage of the model
|
61
|
+
*/
|
62
|
+
export interface Usage {
|
63
|
+
/**
|
64
|
+
* The number of tokens used for the prompt
|
65
|
+
*/
|
66
|
+
prompt_tokens: number;
|
67
|
+
|
68
|
+
/**
|
69
|
+
* The total number of tokens used
|
70
|
+
*/
|
71
|
+
total_tokens: number;
|
72
|
+
|
73
|
+
/**
|
74
|
+
* The number of tokens used for the completion
|
75
|
+
*/
|
76
|
+
completion_tokens?: number | null;
|
77
|
+
}
|
78
|
+
}
|
79
|
+
|
80
|
+
export interface Embedding {
|
81
|
+
/**
|
82
|
+
* The encoded embedding.
|
83
|
+
*/
|
84
|
+
embedding: Array<number> | Array<number> | string;
|
85
|
+
|
86
|
+
/**
|
87
|
+
* The index of the embedding.
|
88
|
+
*/
|
89
|
+
index: number;
|
90
|
+
|
91
|
+
/**
|
92
|
+
* The object type of the embedding.
|
93
|
+
*/
|
94
|
+
object?: 'embedding';
|
95
|
+
}
|
96
|
+
|
97
|
+
export interface MultiEncodingEmbedding {
|
98
|
+
/**
|
99
|
+
* The encoded embedding data by encoding format.Returned, if more than one
|
100
|
+
* encoding format is used.
|
101
|
+
*/
|
102
|
+
embedding: MultiEncodingEmbedding.Embedding;
|
103
|
+
|
104
|
+
/**
|
105
|
+
* The index of the embedding.
|
106
|
+
*/
|
107
|
+
index: number;
|
108
|
+
|
109
|
+
/**
|
110
|
+
* The object type of the embedding.
|
111
|
+
*/
|
112
|
+
object?: 'embedding_dict';
|
113
|
+
}
|
114
|
+
|
115
|
+
export namespace MultiEncodingEmbedding {
|
116
|
+
/**
|
117
|
+
* The encoded embedding data by encoding format.Returned, if more than one
|
118
|
+
* encoding format is used.
|
119
|
+
*/
|
120
|
+
export interface Embedding {
|
121
|
+
float?: Array<number>;
|
122
|
+
|
123
|
+
int8?: Array<number>;
|
124
|
+
|
125
|
+
uint8?: Array<number>;
|
126
|
+
|
127
|
+
binary?: Array<number>;
|
128
|
+
|
129
|
+
ubinary?: Array<number>;
|
130
|
+
|
131
|
+
base64?: string;
|
132
|
+
}
|
133
|
+
}
|
134
|
+
|
3
135
|
/**
|
4
136
|
* Info Pydantic Response Service Message
|
5
137
|
*/
|
@@ -150,7 +282,7 @@ export interface RerankParams {
|
|
150
282
|
/**
|
151
283
|
* The input documents to rerank.
|
152
284
|
*/
|
153
|
-
input: Array<string | unknown
|
285
|
+
input: Array<string | unknown | Array<unknown>>;
|
154
286
|
|
155
287
|
/**
|
156
288
|
* The fields of the documents to rank.
|
@@ -170,6 +302,9 @@ export interface RerankParams {
|
|
170
302
|
|
171
303
|
export declare namespace TopLevel {
|
172
304
|
export {
|
305
|
+
type Em as Em,
|
306
|
+
type Embedding as Embedding,
|
307
|
+
type MultiEncodingEmbedding as MultiEncodingEmbedding,
|
173
308
|
type InfoResponse as InfoResponse,
|
174
309
|
type RerankResponse as RerankResponse,
|
175
310
|
type EmbedParams as EmbedParams,
|
package/src/version.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const VERSION = '0.1.0-alpha.
|
1
|
+
export const VERSION = '0.1.0-alpha.20'; // x-release-please-version
|
package/version.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export declare const VERSION = "0.1.0-alpha.
|
1
|
+
export declare const VERSION = "0.1.0-alpha.20";
|
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.1.0-alpha.
|
4
|
+
exports.VERSION = '0.1.0-alpha.20'; // x-release-please-version
|
5
5
|
//# sourceMappingURL=version.js.map
|
package/version.mjs
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export const VERSION = '0.1.0-alpha.
|
1
|
+
export const VERSION = '0.1.0-alpha.20'; // x-release-please-version
|
2
2
|
//# sourceMappingURL=version.mjs.map
|