modelfusion 0.56.0 → 0.57.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.
@@ -10,17 +10,33 @@ const CohereError_js_1 = require("./CohereError.cjs");
10
10
  const CohereTokenizer_js_1 = require("./CohereTokenizer.cjs");
11
11
  exports.COHERE_TEXT_EMBEDDING_MODELS = {
12
12
  "embed-english-light-v2.0": {
13
- contextWindowSize: 4096,
13
+ contextWindowSize: 512,
14
14
  embeddingDimensions: 1024,
15
15
  },
16
16
  "embed-english-v2.0": {
17
- contextWindowSize: 4096,
17
+ contextWindowSize: 512,
18
18
  embeddingDimensions: 4096,
19
19
  },
20
20
  "embed-multilingual-v2.0": {
21
- contextWindowSize: 4096,
21
+ contextWindowSize: 512,
22
22
  embeddingDimensions: 768,
23
23
  },
24
+ "embed-english-v3.0": {
25
+ contextWindowSize: 512,
26
+ embeddingDimensions: 1024,
27
+ },
28
+ "embed-english-light-v3.0": {
29
+ contextWindowSize: 512,
30
+ embeddingDimensions: 384,
31
+ },
32
+ "embed-multilingual-v3.0": {
33
+ contextWindowSize: 512,
34
+ embeddingDimensions: 1024,
35
+ },
36
+ "embed-multilingual-light-v3.0": {
37
+ contextWindowSize: 512,
38
+ embeddingDimensions: 384,
39
+ },
24
40
  };
25
41
  /**
26
42
  * Create a text embedding model that calls the Cohere Co.Embed API.
@@ -137,13 +153,14 @@ const cohereTextEmbeddingResponseSchema = zod_1.z.object({
137
153
  }),
138
154
  }),
139
155
  });
140
- async function callCohereEmbeddingAPI({ api = new CohereApiConfiguration_js_1.CohereApiConfiguration(), abortSignal, model, texts, truncate, }) {
156
+ async function callCohereEmbeddingAPI({ api = new CohereApiConfiguration_js_1.CohereApiConfiguration(), abortSignal, model, texts, inputType, truncate, }) {
141
157
  return (0, postToApi_js_1.postJsonToApi)({
142
158
  url: api.assembleUrl(`/embed`),
143
159
  headers: api.headers,
144
160
  body: {
145
161
  model,
146
162
  texts,
163
+ input_type: inputType,
147
164
  truncate,
148
165
  },
149
166
  failedResponseHandler: CohereError_js_1.failedCohereCallResponseHandler,
@@ -17,11 +17,28 @@ export declare const COHERE_TEXT_EMBEDDING_MODELS: {
17
17
  contextWindowSize: number;
18
18
  embeddingDimensions: number;
19
19
  };
20
+ "embed-english-v3.0": {
21
+ contextWindowSize: number;
22
+ embeddingDimensions: number;
23
+ };
24
+ "embed-english-light-v3.0": {
25
+ contextWindowSize: number;
26
+ embeddingDimensions: number;
27
+ };
28
+ "embed-multilingual-v3.0": {
29
+ contextWindowSize: number;
30
+ embeddingDimensions: number;
31
+ };
32
+ "embed-multilingual-light-v3.0": {
33
+ contextWindowSize: number;
34
+ embeddingDimensions: number;
35
+ };
20
36
  };
21
37
  export type CohereTextEmbeddingModelType = keyof typeof COHERE_TEXT_EMBEDDING_MODELS;
22
38
  export interface CohereTextEmbeddingModelSettings extends EmbeddingModelSettings {
23
39
  api?: ApiConfiguration;
24
40
  model: CohereTextEmbeddingModelType;
41
+ inputType?: "search_document" | "search_query" | "classification" | "clustering";
25
42
  truncate?: "NONE" | "START" | "END";
26
43
  }
27
44
  /**
@@ -41,7 +58,7 @@ export interface CohereTextEmbeddingModelSettings extends EmbeddingModelSettings
41
58
  export declare class CohereTextEmbeddingModel extends AbstractModel<CohereTextEmbeddingModelSettings> implements EmbeddingModel<string, CohereTextEmbeddingModelSettings>, FullTokenizer {
42
59
  constructor(settings: CohereTextEmbeddingModelSettings);
43
60
  readonly provider: "cohere";
44
- get modelName(): "embed-english-light-v2.0" | "embed-english-v2.0" | "embed-multilingual-v2.0";
61
+ get modelName(): "embed-english-light-v2.0" | "embed-english-v2.0" | "embed-multilingual-v2.0" | "embed-english-v3.0" | "embed-english-light-v3.0" | "embed-multilingual-v3.0" | "embed-multilingual-light-v3.0";
45
62
  readonly maxValuesPerCall = 96;
46
63
  readonly isParallizable = true;
47
64
  readonly embeddingDimensions: number;
@@ -7,17 +7,33 @@ import { failedCohereCallResponseHandler } from "./CohereError.js";
7
7
  import { CohereTokenizer } from "./CohereTokenizer.js";
8
8
  export const COHERE_TEXT_EMBEDDING_MODELS = {
9
9
  "embed-english-light-v2.0": {
10
- contextWindowSize: 4096,
10
+ contextWindowSize: 512,
11
11
  embeddingDimensions: 1024,
12
12
  },
13
13
  "embed-english-v2.0": {
14
- contextWindowSize: 4096,
14
+ contextWindowSize: 512,
15
15
  embeddingDimensions: 4096,
16
16
  },
17
17
  "embed-multilingual-v2.0": {
18
- contextWindowSize: 4096,
18
+ contextWindowSize: 512,
19
19
  embeddingDimensions: 768,
20
20
  },
21
+ "embed-english-v3.0": {
22
+ contextWindowSize: 512,
23
+ embeddingDimensions: 1024,
24
+ },
25
+ "embed-english-light-v3.0": {
26
+ contextWindowSize: 512,
27
+ embeddingDimensions: 384,
28
+ },
29
+ "embed-multilingual-v3.0": {
30
+ contextWindowSize: 512,
31
+ embeddingDimensions: 1024,
32
+ },
33
+ "embed-multilingual-light-v3.0": {
34
+ contextWindowSize: 512,
35
+ embeddingDimensions: 384,
36
+ },
21
37
  };
22
38
  /**
23
39
  * Create a text embedding model that calls the Cohere Co.Embed API.
@@ -133,13 +149,14 @@ const cohereTextEmbeddingResponseSchema = z.object({
133
149
  }),
134
150
  }),
135
151
  });
136
- async function callCohereEmbeddingAPI({ api = new CohereApiConfiguration(), abortSignal, model, texts, truncate, }) {
152
+ async function callCohereEmbeddingAPI({ api = new CohereApiConfiguration(), abortSignal, model, texts, inputType, truncate, }) {
137
153
  return postJsonToApi({
138
154
  url: api.assembleUrl(`/embed`),
139
155
  headers: api.headers,
140
156
  body: {
141
157
  model,
142
158
  texts,
159
+ input_type: inputType,
143
160
  truncate,
144
161
  },
145
162
  failedResponseHandler: failedCohereCallResponseHandler,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "modelfusion",
3
3
  "description": "Build multimodal applications, chatbots, and agents with JavaScript and TypeScript.",
4
- "version": "0.56.0",
4
+ "version": "0.57.0",
5
5
  "author": "Lars Grammel",
6
6
  "license": "MIT",
7
7
  "keywords": [