@ai-sdk/cohere 4.0.88 → 4.0.90

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 CHANGED
@@ -1,5 +1,21 @@
1
1
  # @ai-sdk/cohere
2
2
 
3
+ ## 4.0.90
4
+
5
+ ### Patch Changes
6
+
7
+ - 23fea38: refactor(cohere): declare model capabilities per model ID
8
+ - Updated dependencies [f958ef0]
9
+ - @ai-sdk/provider@4.0.40
10
+ - @ai-sdk/provider-utils@5.0.87
11
+
12
+ ## 4.0.89
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies [743e15b]
17
+ - @ai-sdk/provider-utils@5.0.86
18
+
3
19
  ## 4.0.88
4
20
 
5
21
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -28,11 +28,6 @@ type CohereRerankingModelOptions = {
28
28
  };
29
29
  //#endregion
30
30
  //#region src/cohere-model-catalog.d.ts
31
- type EmbeddingType = NonNullable<CohereEmbeddingModelOptions['embeddingType']>;
32
- type EmbeddingRequestConfig = {
33
- embeddingType: EmbeddingType;
34
- inputType: NonNullable<CohereEmbeddingModelOptions['inputType']>;
35
- };
36
31
  type CohereRerankingModelEntry = {
37
32
  capabilities: {
38
33
  reranking: NonNullable<ModelCapabilities['reranking']>;
@@ -41,254 +36,144 @@ type CohereRerankingModelEntry = {
41
36
  reranking: Record<keyof CohereRerankingModelOptions, ModelCapability>;
42
37
  };
43
38
  };
44
- declare const languageDefinitions: {
39
+ /**
40
+ * Language model matrix: model IDs by capability. To add a model, add a row
41
+ * and fill in every column.
42
+ */
43
+ declare const languageModelDefinitions: {
45
44
  'command-a-03-2025': {
46
- image: boolean;
47
- objectGeneration: boolean;
48
- tools: boolean;
45
+ image: false;
46
+ objectGeneration: true;
47
+ functionTools: "streaming"[];
48
+ reasoning: "unknown";
49
49
  };
50
50
  'command-a-reasoning-08-2025': {
51
+ image: false;
52
+ objectGeneration: true;
53
+ functionTools: "streaming"[];
51
54
  reasoning: true;
52
- image: boolean;
53
- objectGeneration: boolean;
54
- tools: boolean;
55
55
  };
56
56
  'command-a-vision-07-2025': {
57
57
  image: true;
58
- objectGeneration: boolean;
59
- tools: boolean;
58
+ objectGeneration: true;
59
+ functionTools: "streaming"[];
60
+ reasoning: "unknown";
60
61
  };
61
62
  'command-r7b-12-2024': {
62
- image: boolean;
63
- objectGeneration: boolean;
64
- tools: boolean;
63
+ image: false;
64
+ objectGeneration: true;
65
+ functionTools: "streaming"[];
66
+ reasoning: "unknown";
65
67
  };
66
68
  'command-r-plus-04-2024': {
67
- image: boolean;
68
- objectGeneration: boolean;
69
- tools: boolean;
69
+ image: false;
70
+ objectGeneration: true;
71
+ functionTools: "streaming"[];
72
+ reasoning: "unknown";
70
73
  };
71
74
  'command-r-plus': {
72
- image: boolean;
73
- objectGeneration: boolean;
74
- tools: boolean;
75
+ image: false;
76
+ objectGeneration: true;
77
+ functionTools: "streaming"[];
78
+ reasoning: "unknown";
75
79
  };
76
80
  'command-r-08-2024': {
77
- image: boolean;
78
- objectGeneration: boolean;
79
- tools: boolean;
81
+ image: false;
82
+ objectGeneration: true;
83
+ functionTools: "streaming"[];
84
+ reasoning: "unknown";
80
85
  };
81
86
  'command-r-03-2024': {
82
- image: boolean;
83
- objectGeneration: boolean;
84
- tools: boolean;
87
+ image: false;
88
+ objectGeneration: true;
89
+ functionTools: "streaming"[];
90
+ reasoning: "unknown";
85
91
  };
86
92
  'command-r': {
87
- image: boolean;
88
- objectGeneration: boolean;
89
- tools: boolean;
93
+ image: false;
94
+ objectGeneration: true;
95
+ functionTools: "streaming"[];
96
+ reasoning: "unknown";
90
97
  };
91
98
  command: {
92
- image: boolean;
93
- objectGeneration: boolean;
94
- tools: boolean;
99
+ image: false;
100
+ objectGeneration: false;
101
+ functionTools: false;
102
+ reasoning: "unknown";
95
103
  };
96
104
  'command-nightly': {
97
- image: boolean;
98
- objectGeneration: boolean;
99
- tools: boolean;
105
+ image: false;
106
+ objectGeneration: false;
107
+ functionTools: false;
108
+ reasoning: "unknown";
100
109
  };
101
110
  'command-light': {
102
- image: boolean;
103
- objectGeneration: boolean;
104
- tools: boolean;
111
+ image: false;
112
+ objectGeneration: false;
113
+ functionTools: false;
114
+ reasoning: "unknown";
105
115
  };
106
116
  'command-light-nightly': {
107
- image: boolean;
108
- objectGeneration: boolean;
109
- tools: boolean;
117
+ image: false;
118
+ objectGeneration: false;
119
+ functionTools: false;
120
+ reasoning: "unknown";
110
121
  };
111
122
  };
112
- declare const cohereEmbeddingModelEntries: {
123
+ /**
124
+ * Embedding model matrix: model IDs by capability. To add a model, add a row
125
+ * and fill in every column.
126
+ */
127
+ declare const embeddingModelDefinitions: {
113
128
  'embed-v5.0-pro': {
114
- capabilities: {
115
- embedding: {
116
- maxEmbeddingsPerCall: 96;
117
- supportsParallelCalls: true;
118
- defaultDimensions: number;
119
- customDimensions: boolean;
120
- dimensions: readonly number[];
121
- embeddingTypes: readonly EmbeddingType[];
122
- };
123
- };
124
- providerOptions: {
125
- embedding: Record<"embeddingType" | "inputType" | "truncate" | "outputDimension", ModelCapability>;
126
- };
127
- requestConfig: {
128
- embedding: EmbeddingRequestConfig;
129
- };
129
+ defaultDimensions: number;
130
+ dimensions: number[];
131
+ embeddingTypes: ("float" | "int8" | "uint8" | "binary" | "ubinary")[];
130
132
  };
131
133
  'embed-v5.0-fast': {
132
- capabilities: {
133
- embedding: {
134
- maxEmbeddingsPerCall: 96;
135
- supportsParallelCalls: true;
136
- defaultDimensions: number;
137
- customDimensions: boolean;
138
- dimensions: readonly number[];
139
- embeddingTypes: readonly EmbeddingType[];
140
- };
141
- };
142
- providerOptions: {
143
- embedding: Record<"embeddingType" | "inputType" | "truncate" | "outputDimension", ModelCapability>;
144
- };
145
- requestConfig: {
146
- embedding: EmbeddingRequestConfig;
147
- };
134
+ defaultDimensions: number;
135
+ dimensions: number[];
136
+ embeddingTypes: ("float" | "int8" | "uint8" | "binary" | "ubinary")[];
148
137
  };
149
138
  'embed-v4.0': {
150
- capabilities: {
151
- embedding: {
152
- maxEmbeddingsPerCall: 96;
153
- supportsParallelCalls: true;
154
- defaultDimensions: number;
155
- customDimensions: boolean;
156
- dimensions: readonly number[];
157
- embeddingTypes: readonly EmbeddingType[];
158
- };
159
- };
160
- providerOptions: {
161
- embedding: Record<"embeddingType" | "inputType" | "truncate" | "outputDimension", ModelCapability>;
162
- };
163
- requestConfig: {
164
- embedding: EmbeddingRequestConfig;
165
- };
139
+ defaultDimensions: number;
140
+ dimensions: number[];
141
+ embeddingTypes: ("float" | "int8" | "uint8" | "binary" | "ubinary")[];
166
142
  };
167
143
  'embed-english-v3.0': {
168
- capabilities: {
169
- embedding: {
170
- maxEmbeddingsPerCall: 96;
171
- supportsParallelCalls: true;
172
- defaultDimensions: number;
173
- customDimensions: boolean;
174
- dimensions: readonly number[];
175
- embeddingTypes: readonly EmbeddingType[];
176
- };
177
- };
178
- providerOptions: {
179
- embedding: Record<"embeddingType" | "inputType" | "truncate" | "outputDimension", ModelCapability>;
180
- };
181
- requestConfig: {
182
- embedding: EmbeddingRequestConfig;
183
- };
144
+ defaultDimensions: number;
145
+ dimensions: number[];
146
+ embeddingTypes: ("float" | "int8" | "uint8" | "binary" | "ubinary")[];
184
147
  };
185
148
  'embed-multilingual-v3.0': {
186
- capabilities: {
187
- embedding: {
188
- maxEmbeddingsPerCall: 96;
189
- supportsParallelCalls: true;
190
- defaultDimensions: number;
191
- customDimensions: boolean;
192
- dimensions: readonly number[];
193
- embeddingTypes: readonly EmbeddingType[];
194
- };
195
- };
196
- providerOptions: {
197
- embedding: Record<"embeddingType" | "inputType" | "truncate" | "outputDimension", ModelCapability>;
198
- };
199
- requestConfig: {
200
- embedding: EmbeddingRequestConfig;
201
- };
149
+ defaultDimensions: number;
150
+ dimensions: number[];
151
+ embeddingTypes: ("float" | "int8" | "uint8" | "binary" | "ubinary")[];
202
152
  };
203
153
  'embed-english-light-v3.0': {
204
- capabilities: {
205
- embedding: {
206
- maxEmbeddingsPerCall: 96;
207
- supportsParallelCalls: true;
208
- defaultDimensions: number;
209
- customDimensions: boolean;
210
- dimensions: readonly number[];
211
- embeddingTypes: readonly EmbeddingType[];
212
- };
213
- };
214
- providerOptions: {
215
- embedding: Record<"embeddingType" | "inputType" | "truncate" | "outputDimension", ModelCapability>;
216
- };
217
- requestConfig: {
218
- embedding: EmbeddingRequestConfig;
219
- };
154
+ defaultDimensions: number;
155
+ dimensions: number[];
156
+ embeddingTypes: ("float" | "int8" | "uint8" | "binary" | "ubinary")[];
220
157
  };
221
158
  'embed-multilingual-light-v3.0': {
222
- capabilities: {
223
- embedding: {
224
- maxEmbeddingsPerCall: 96;
225
- supportsParallelCalls: true;
226
- defaultDimensions: number;
227
- customDimensions: boolean;
228
- dimensions: readonly number[];
229
- embeddingTypes: readonly EmbeddingType[];
230
- };
231
- };
232
- providerOptions: {
233
- embedding: Record<"embeddingType" | "inputType" | "truncate" | "outputDimension", ModelCapability>;
234
- };
235
- requestConfig: {
236
- embedding: EmbeddingRequestConfig;
237
- };
159
+ defaultDimensions: number;
160
+ dimensions: number[];
161
+ embeddingTypes: ("float" | "int8" | "uint8" | "binary" | "ubinary")[];
238
162
  };
239
163
  'embed-english-v2.0': {
240
- capabilities: {
241
- embedding: {
242
- maxEmbeddingsPerCall: 96;
243
- supportsParallelCalls: true;
244
- defaultDimensions: number;
245
- customDimensions: boolean;
246
- dimensions: readonly number[];
247
- embeddingTypes: readonly EmbeddingType[];
248
- };
249
- };
250
- providerOptions: {
251
- embedding: Record<"embeddingType" | "inputType" | "truncate" | "outputDimension", ModelCapability>;
252
- };
253
- requestConfig: {
254
- embedding: EmbeddingRequestConfig;
255
- };
164
+ defaultDimensions: number;
165
+ dimensions: number[];
166
+ embeddingTypes: "float"[];
256
167
  };
257
168
  'embed-english-light-v2.0': {
258
- capabilities: {
259
- embedding: {
260
- maxEmbeddingsPerCall: 96;
261
- supportsParallelCalls: true;
262
- defaultDimensions: number;
263
- customDimensions: boolean;
264
- dimensions: readonly number[];
265
- embeddingTypes: readonly EmbeddingType[];
266
- };
267
- };
268
- providerOptions: {
269
- embedding: Record<"embeddingType" | "inputType" | "truncate" | "outputDimension", ModelCapability>;
270
- };
271
- requestConfig: {
272
- embedding: EmbeddingRequestConfig;
273
- };
169
+ defaultDimensions: number;
170
+ dimensions: number[];
171
+ embeddingTypes: "float"[];
274
172
  };
275
173
  'embed-multilingual-v2.0': {
276
- capabilities: {
277
- embedding: {
278
- maxEmbeddingsPerCall: 96;
279
- supportsParallelCalls: true;
280
- defaultDimensions: number;
281
- customDimensions: boolean;
282
- dimensions: readonly number[];
283
- embeddingTypes: readonly EmbeddingType[];
284
- };
285
- };
286
- providerOptions: {
287
- embedding: Record<"embeddingType" | "inputType" | "truncate" | "outputDimension", ModelCapability>;
288
- };
289
- requestConfig: {
290
- embedding: EmbeddingRequestConfig;
291
- };
174
+ defaultDimensions: number;
175
+ dimensions: number[];
176
+ embeddingTypes: "float"[];
292
177
  };
293
178
  };
294
179
  declare const cohereRerankingModelEntries: {
@@ -300,8 +185,8 @@ declare const cohereRerankingModelEntries: {
300
185
  };
301
186
  /** Known model IDs, derived from the declarations used to build the catalog. */
302
187
  type CohereModelIds = {
303
- language: keyof typeof languageDefinitions;
304
- embedding: keyof typeof cohereEmbeddingModelEntries;
188
+ language: keyof typeof languageModelDefinitions;
189
+ embedding: keyof typeof embeddingModelDefinitions;
305
190
  reranking: keyof typeof cohereRerankingModelEntries;
306
191
  };
307
192
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/cohere-embedding-model-options.ts","../src/reranking/cohere-reranking-model-options.ts","../src/cohere-model-catalog.ts","../src/cohere-chat-language-model-options.ts","../src/cohere-provider.ts","../src/version.ts"],"mappings":";;;KAQY,yBACR;cAGS,8DAA2B;;;;;;KA4D5B,8BAA8B,mBACjC;;;KChEG,yBACR;KAGQ;;;;;;EAMV;;;;;;EAOA;;;;KCyBG,gBAAgB,YAAY;KAS5B;EACH,eAAe;EACf,WAAW,YAAY;;KAoBpB;EACH;IAAgB,WAAW,YAAY;;EACvC;IACE,WAAW,aAAa,6BAA6B;;;cA+BnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA2HA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAuBA;;;;;;;;KA4FM;EACV,uBAAuB;EACvB,wBAAwB;EACxB,wBAAwB;;;;KC5Vd,oBAAoB;cAEnB,iEAA8B;;;;;;KAqB/B,iCAAiC,mBACpC;;;UCTQ,uBAAuB;GACrC,SAAS,oBAAoB;;;;EAK9B,cAAc,SAAS,oBAAoB;;;;EAK3C,UAAU,SAAS,yBAAyB;;;;EAK5C,eAAe,SAAS,yBAAyB;;;;EAKjD,cAAc,SAAS,yBAAyB;;;;EAKhD,mBAAmB,SAAS,yBAAyB;;;;EAKrD,UAAU,SAAS,yBAAyB;;;;EAK5C,eAAe,SAAS,yBAAyB;;UAGlC;;;;;EAKf;;;;;EAMA,SAAS;;;;EAKT,UAAU;;;;;EAMV,QAAQ;;;;EAKR;;;;;wBAMc,aACd,UAAS,yBACR;;;;qBAyEU,QAAM;;;qBCzKN"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/cohere-embedding-model-options.ts","../src/reranking/cohere-reranking-model-options.ts","../src/cohere-model-catalog.ts","../src/cohere-chat-language-model-options.ts","../src/cohere-provider.ts","../src/version.ts"],"mappings":";;;KAQY,yBACR;cAGS,8DAA2B;;;;;;KA4D5B,8BAA8B,mBACjC;;;KChEG,yBACR;KAGQ;;;;;;EAMV;;;;;;EAOA;;;;KCwDG;EACH;IAAgB,WAAW,YAAY;;EACvC;IACE,WAAW,aAAa,6BAA6B;;;;;;;cA8CnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAmNA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA2DA;;;;;;;;KAuFM;EACV,uBAAuB;EACvB,wBAAwB;EACxB,wBAAwB;;;;KCled,oBAAoB;cAEnB,iEAA8B;;;;;;KAqB/B,iCAAiC,mBACpC;;;UCTQ,uBAAuB;GACrC,SAAS,oBAAoB;;;;EAK9B,cAAc,SAAS,oBAAoB;;;;EAK3C,UAAU,SAAS,yBAAyB;;;;EAK5C,eAAe,SAAS,yBAAyB;;;;EAKjD,cAAc,SAAS,yBAAyB;;;;EAKhD,mBAAmB,SAAS,yBAAyB;;;;EAKrD,UAAU,SAAS,yBAAyB;;;;EAK5C,eAAe,SAAS,yBAAyB;;UAGlC;;;;;EAKf;;;;;EAMA,SAAS;;;;EAKT,UAAU;;;;;EAMV,QAAQ;;;;EAKR;;;;;wBAMc,aACd,UAAS,yBACR;;;;qBAyEU,QAAM;;;qBCzKN"}