@ai-sdk/cohere 4.0.0-beta.5 → 4.0.0-beta.54

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,406 @@
1
1
  # @ai-sdk/cohere
2
2
 
3
+ ## 4.0.0-beta.54
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [0416e3e]
8
+ - @ai-sdk/provider@4.0.0-beta.20
9
+ - @ai-sdk/provider-utils@5.0.0-beta.50
10
+
11
+ ## 4.0.0-beta.53
12
+
13
+ ### Patch Changes
14
+
15
+ - b8396f0: trigger initial beta release
16
+ - Updated dependencies [b8396f0]
17
+ - @ai-sdk/provider-utils@5.0.0-beta.49
18
+ - @ai-sdk/provider@4.0.0-beta.19
19
+
20
+ ## 4.0.0-canary.52
21
+
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies [aeda373]
25
+ - Updated dependencies [375fdd7]
26
+ - Updated dependencies [b4507d5]
27
+ - @ai-sdk/provider-utils@5.0.0-canary.48
28
+
29
+ ## 4.0.0-canary.51
30
+
31
+ ### Patch Changes
32
+
33
+ - Updated dependencies [bae5e2b]
34
+ - @ai-sdk/provider-utils@5.0.0-canary.47
35
+
36
+ ## 4.0.0-canary.50
37
+
38
+ ### Patch Changes
39
+
40
+ - Updated dependencies [ce769dd]
41
+ - @ai-sdk/provider@4.0.0-canary.18
42
+ - @ai-sdk/provider-utils@5.0.0-canary.46
43
+
44
+ ## 4.0.0-canary.49
45
+
46
+ ### Patch Changes
47
+
48
+ - Updated dependencies [ee798eb]
49
+ - Updated dependencies [daf6637]
50
+ - @ai-sdk/provider-utils@5.0.0-canary.45
51
+
52
+ ## 4.0.0-canary.48
53
+
54
+ ### Patch Changes
55
+
56
+ - Updated dependencies [6c93e36]
57
+ - Updated dependencies [f617ac2]
58
+ - @ai-sdk/provider-utils@5.0.0-canary.44
59
+
60
+ ## 4.0.0-canary.47
61
+
62
+ ### Patch Changes
63
+
64
+ - 7fc6bd6: Raise minimum supported Node.js version to 22. Supported versions: 22, 24, and 26.
65
+ - Updated dependencies [7fc6bd6]
66
+ - @ai-sdk/provider-utils@5.0.0-canary.43
67
+ - @ai-sdk/provider@4.0.0-canary.17
68
+
69
+ ## 4.0.0-canary.46
70
+
71
+ ### Patch Changes
72
+
73
+ - Updated dependencies [a6617c5]
74
+ - @ai-sdk/provider-utils@5.0.0-canary.42
75
+
76
+ ## 4.0.0-canary.45
77
+
78
+ ### Patch Changes
79
+
80
+ - Updated dependencies [28dfa06]
81
+ - Updated dependencies [e93fa91]
82
+ - @ai-sdk/provider-utils@5.0.0-canary.41
83
+
84
+ ## 4.0.0-canary.44
85
+
86
+ ### Patch Changes
87
+
88
+ - 3cfb762: Harden streamed tool call argument parsing against prototype keys.
89
+
90
+ ## 4.0.0-canary.43
91
+
92
+ ### Patch Changes
93
+
94
+ - Updated dependencies [a7de9c9]
95
+ - @ai-sdk/provider-utils@5.0.0-canary.40
96
+
97
+ ## 4.0.0-canary.42
98
+
99
+ ### Patch Changes
100
+
101
+ - Updated dependencies [105f95b]
102
+ - @ai-sdk/provider-utils@5.0.0-canary.39
103
+
104
+ ## 4.0.0-canary.41
105
+
106
+ ### Patch Changes
107
+
108
+ - Updated dependencies [ca446f8]
109
+ - @ai-sdk/provider-utils@5.0.0-canary.38
110
+
111
+ ## 4.0.0-canary.40
112
+
113
+ ### Patch Changes
114
+
115
+ - Updated dependencies [d848405]
116
+ - @ai-sdk/provider-utils@5.0.0-canary.37
117
+
118
+ ## 4.0.0-canary.39
119
+
120
+ ### Patch Changes
121
+
122
+ - Updated dependencies [ca39020]
123
+ - @ai-sdk/provider-utils@5.0.0-canary.36
124
+
125
+ ## 4.0.0-canary.38
126
+
127
+ ### Patch Changes
128
+
129
+ - Updated dependencies [f634bac]
130
+ - @ai-sdk/provider-utils@5.0.0-canary.35
131
+
132
+ ## 4.0.0-canary.37
133
+
134
+ ### Patch Changes
135
+
136
+ - Updated dependencies [69254e0]
137
+ - Updated dependencies [3015fc3]
138
+ - @ai-sdk/provider-utils@5.0.0-canary.34
139
+
140
+ ## 4.0.0-canary.36
141
+
142
+ ### Patch Changes
143
+
144
+ - Updated dependencies [2427d88]
145
+ - @ai-sdk/provider-utils@5.0.0-canary.33
146
+
147
+ ## 4.0.0-canary.35
148
+
149
+ ### Patch Changes
150
+
151
+ - Updated dependencies [5463d0d]
152
+ - @ai-sdk/provider-utils@5.0.0-canary.32
153
+ - @ai-sdk/provider@4.0.0-canary.16
154
+
155
+ ## 4.0.0-canary.34
156
+
157
+ ### Patch Changes
158
+
159
+ - f2919d5: feat(provider/cohere): add support for passing images to Cohere models
160
+
161
+ ## 4.0.0-canary.33
162
+
163
+ ### Patch Changes
164
+
165
+ - 0c4c275: trigger initial canary release
166
+ - Updated dependencies [0c4c275]
167
+ - @ai-sdk/provider-utils@5.0.0-canary.31
168
+ - @ai-sdk/provider@4.0.0-canary.15
169
+
170
+ ## 4.0.0-beta.32
171
+
172
+ ### Major Changes
173
+
174
+ - 04e9009: chore: make provider implementations code patterns more consistent, including renaming certain exported symbols
175
+
176
+ For all externally exported symbols that were renamed, the old names continue to work via deprecated aliases.
177
+
178
+ ### Patch Changes
179
+
180
+ - Updated dependencies [08d2129]
181
+ - @ai-sdk/provider-utils@5.0.0-beta.30
182
+
183
+ ## 4.0.0-beta.31
184
+
185
+ ### Patch Changes
186
+
187
+ - 9bd6512: feat(provider): change file part data property to be tagged with a type and remove the image part type
188
+ - 258c093: chore: ensure consistent import handling and avoid import duplicates or cycles
189
+ - Updated dependencies [9bd6512]
190
+ - Updated dependencies [258c093]
191
+ - Updated dependencies [b6783da]
192
+ - @ai-sdk/provider-utils@5.0.0-beta.29
193
+ - @ai-sdk/provider@4.0.0-beta.14
194
+
195
+ ## 4.0.0-beta.30
196
+
197
+ ### Patch Changes
198
+
199
+ - 9f0e36c: trigger release for all packages after provenance setup
200
+ - Updated dependencies [9f0e36c]
201
+ - @ai-sdk/provider@4.0.0-beta.13
202
+ - @ai-sdk/provider-utils@5.0.0-beta.28
203
+
204
+ ## 4.0.0-beta.29
205
+
206
+ ### Patch Changes
207
+
208
+ - 58a2ad7: fix: more precise default message for tool execution denial
209
+ - Updated dependencies [785fe16]
210
+ - Updated dependencies [67df0a0]
211
+ - Updated dependencies [befb78c]
212
+ - Updated dependencies [0458559]
213
+ - Updated dependencies [5852c0a]
214
+ - Updated dependencies [fc92055]
215
+ - @ai-sdk/provider-utils@5.0.0-beta.27
216
+
217
+ ## 4.0.0-beta.28
218
+
219
+ ### Patch Changes
220
+
221
+ - Updated dependencies [2e98477]
222
+ - @ai-sdk/provider-utils@5.0.0-beta.26
223
+
224
+ ## 4.0.0-beta.27
225
+
226
+ ### Patch Changes
227
+
228
+ - Updated dependencies [eea8d98]
229
+ - @ai-sdk/provider-utils@5.0.0-beta.25
230
+
231
+ ## 4.0.0-beta.26
232
+
233
+ ### Patch Changes
234
+
235
+ - Updated dependencies [f807e45]
236
+ - @ai-sdk/provider-utils@5.0.0-beta.24
237
+
238
+ ## 4.0.0-beta.25
239
+
240
+ ### Patch Changes
241
+
242
+ - Updated dependencies [350ea38]
243
+ - @ai-sdk/provider-utils@5.0.0-beta.23
244
+
245
+ ## 4.0.0-beta.24
246
+
247
+ ### Patch Changes
248
+
249
+ - Updated dependencies [083947b]
250
+ - @ai-sdk/provider-utils@5.0.0-beta.22
251
+
252
+ ## 4.0.0-beta.23
253
+
254
+ ### Patch Changes
255
+
256
+ - Updated dependencies [add1126]
257
+ - @ai-sdk/provider-utils@5.0.0-beta.21
258
+
259
+ ## 4.0.0-beta.22
260
+
261
+ ### Patch Changes
262
+
263
+ - b3976a2: Add workflow serialization support to all provider models.
264
+
265
+ **`@ai-sdk/provider-utils`:** New `serializeModel()` helper that extracts only serializable properties from a model instance, filtering out functions and objects containing functions. Third-party provider authors can use this to add workflow support to their own models.
266
+
267
+ **All providers:** `headers` is now optional in provider config types. This is non-breaking — existing code that passes `headers` continues to work. Custom provider implementations that construct model configs manually can now omit `headers`, which is useful when models are deserialized from a workflow step boundary where auth is provided separately.
268
+
269
+ All provider model classes now include `WORKFLOW_SERIALIZE` and `WORKFLOW_DESERIALIZE` static methods, enabling them to cross workflow step boundaries without serialization errors.
270
+
271
+ - Updated dependencies [b3976a2]
272
+ - Updated dependencies [ff5eba1]
273
+ - @ai-sdk/provider-utils@5.0.0-beta.20
274
+ - @ai-sdk/provider@4.0.0-beta.12
275
+
276
+ ## 4.0.0-beta.21
277
+
278
+ ### Major Changes
279
+
280
+ - ef992f8: Remove CommonJS exports from all packages. All packages are now ESM-only (`"type": "module"`). Consumers using `require()` must switch to ESM `import` syntax.
281
+
282
+ ### Patch Changes
283
+
284
+ - Updated dependencies [ef992f8]
285
+ - @ai-sdk/provider@4.0.0-beta.11
286
+ - @ai-sdk/provider-utils@5.0.0-beta.19
287
+
288
+ ## 4.0.0-beta.20
289
+
290
+ ### Patch Changes
291
+
292
+ - 90e2d8a: chore: fix unused vars not being flagged by our lint tooling
293
+ - Updated dependencies [90e2d8a]
294
+ - @ai-sdk/provider-utils@5.0.0-beta.18
295
+
296
+ ## 4.0.0-beta.19
297
+
298
+ ### Patch Changes
299
+
300
+ - Updated dependencies [3ae1786]
301
+ - @ai-sdk/provider-utils@5.0.0-beta.17
302
+
303
+ ## 4.0.0-beta.18
304
+
305
+ ### Patch Changes
306
+
307
+ - Updated dependencies [176466a]
308
+ - @ai-sdk/provider@4.0.0-beta.10
309
+ - @ai-sdk/provider-utils@5.0.0-beta.16
310
+
311
+ ## 4.0.0-beta.17
312
+
313
+ ### Patch Changes
314
+
315
+ - Updated dependencies [e311194]
316
+ - @ai-sdk/provider@4.0.0-beta.9
317
+ - @ai-sdk/provider-utils@5.0.0-beta.15
318
+
319
+ ## 4.0.0-beta.16
320
+
321
+ ### Patch Changes
322
+
323
+ - Updated dependencies [34bd95d]
324
+ - Updated dependencies [008271d]
325
+ - @ai-sdk/provider@4.0.0-beta.8
326
+ - @ai-sdk/provider-utils@5.0.0-beta.14
327
+
328
+ ## 4.0.0-beta.15
329
+
330
+ ### Patch Changes
331
+
332
+ - Updated dependencies [b0c2869]
333
+ - Updated dependencies [7e26e81]
334
+ - @ai-sdk/provider-utils@5.0.0-beta.13
335
+
336
+ ## 4.0.0-beta.14
337
+
338
+ ### Patch Changes
339
+
340
+ - Updated dependencies [46d1149]
341
+ - @ai-sdk/provider-utils@5.0.0-beta.12
342
+
343
+ ## 4.0.0-beta.13
344
+
345
+ ### Patch Changes
346
+
347
+ - 6fd51c0: fix(provider): preserve error type prefix in getErrorMessage
348
+ - Updated dependencies [6fd51c0]
349
+ - @ai-sdk/provider-utils@5.0.0-beta.11
350
+ - @ai-sdk/provider@4.0.0-beta.7
351
+
352
+ ## 4.0.0-beta.12
353
+
354
+ ### Patch Changes
355
+
356
+ - c29a26f: feat(provider): add support for provider references and uploading files as supported per provider
357
+ - Updated dependencies [c29a26f]
358
+ - @ai-sdk/provider-utils@5.0.0-beta.10
359
+ - @ai-sdk/provider@4.0.0-beta.6
360
+
361
+ ## 4.0.0-beta.11
362
+
363
+ ### Patch Changes
364
+
365
+ - 38fc777: Add AI Gateway hint to provider READMEs
366
+
367
+ ## 4.0.0-beta.10
368
+
369
+ ### Patch Changes
370
+
371
+ - Updated dependencies [2e17091]
372
+ - @ai-sdk/provider-utils@5.0.0-beta.9
373
+
374
+ ## 4.0.0-beta.9
375
+
376
+ ### Patch Changes
377
+
378
+ - Updated dependencies [986c6fd]
379
+ - Updated dependencies [493295c]
380
+ - @ai-sdk/provider-utils@5.0.0-beta.8
381
+
382
+ ## 4.0.0-beta.8
383
+
384
+ ### Patch Changes
385
+
386
+ - Updated dependencies [1f509d4]
387
+ - @ai-sdk/provider-utils@5.0.0-beta.7
388
+ - @ai-sdk/provider@4.0.0-beta.5
389
+
390
+ ## 4.0.0-beta.7
391
+
392
+ ### Patch Changes
393
+
394
+ - 74d520f: feat: migrate providers to support new top-level `reasoning` parameter
395
+
396
+ ## 4.0.0-beta.6
397
+
398
+ ### Patch Changes
399
+
400
+ - Updated dependencies [3887c70]
401
+ - @ai-sdk/provider-utils@5.0.0-beta.6
402
+ - @ai-sdk/provider@4.0.0-beta.4
403
+
3
404
  ## 4.0.0-beta.5
4
405
 
5
406
  ### Patch Changes
@@ -247,13 +648,13 @@
247
648
  Before
248
649
 
249
650
  ```ts
250
- model.textEmbeddingModel('my-model-id');
651
+ model.textEmbeddingModel("my-model-id");
251
652
  ```
252
653
 
253
654
  After
254
655
 
255
656
  ```ts
256
- model.embeddingModel('my-model-id');
657
+ model.embeddingModel("my-model-id");
257
658
  ```
258
659
 
259
660
  - 2625a04: feat(openai); update spec for mcp approval
@@ -465,13 +866,13 @@
465
866
  Before
466
867
 
467
868
  ```ts
468
- model.textEmbeddingModel('my-model-id');
869
+ model.textEmbeddingModel("my-model-id");
469
870
  ```
470
871
 
471
872
  After
472
873
 
473
874
  ```ts
474
- model.embeddingModel('my-model-id');
875
+ model.embeddingModel("my-model-id");
475
876
  ```
476
877
 
477
878
  - Updated dependencies [8d9e8ad]
package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  The **[Cohere provider](https://ai-sdk.dev/providers/ai-sdk-providers/cohere)** for the [AI SDK](https://ai-sdk.dev/docs) contains language model support for the Cohere API.
4
4
 
5
+ > **Deploying to Vercel?** With Vercel's AI Gateway you can access Cohere (and hundreds of models from other providers) — no additional packages, API keys, or extra cost. [Get started with AI Gateway](https://vercel.com/ai-gateway).
6
+
5
7
  ## Setup
6
8
 
7
9
  The Cohere provider is available in the `@ai-sdk/cohere` module. You can install it with
package/dist/index.d.ts CHANGED
@@ -2,8 +2,8 @@ import { z } from 'zod/v4';
2
2
  import { ProviderV4, LanguageModelV4, EmbeddingModelV4, RerankingModelV4 } from '@ai-sdk/provider';
3
3
  import { FetchFunction } from '@ai-sdk/provider-utils';
4
4
 
5
- type CohereChatModelId = 'command-a-03-2025' | 'command-a-reasoning-08-2025' | 'command-r7b-12-2024' | 'command-r-plus-04-2024' | 'command-r-plus' | 'command-r-08-2024' | 'command-r-03-2024' | 'command-r' | 'command' | 'command-nightly' | 'command-light' | 'command-light-nightly' | (string & {});
6
- declare const cohereLanguageModelOptions: z.ZodObject<{
5
+ type CohereChatModelId = 'command-a-03-2025' | 'command-a-reasoning-08-2025' | 'command-a-vision-07-2025' | 'command-r7b-12-2024' | 'command-r-plus-04-2024' | 'command-r-plus' | 'command-r-08-2024' | 'command-r-03-2024' | 'command-r' | 'command' | 'command-nightly' | 'command-light' | 'command-light-nightly' | (string & {});
6
+ declare const cohereLanguageModelChatOptions: z.ZodObject<{
7
7
  thinking: z.ZodOptional<z.ZodObject<{
8
8
  type: z.ZodOptional<z.ZodEnum<{
9
9
  enabled: "enabled";
@@ -12,7 +12,7 @@ declare const cohereLanguageModelOptions: z.ZodObject<{
12
12
  tokenBudget: z.ZodOptional<z.ZodNumber>;
13
13
  }, z.core.$strip>>;
14
14
  }, z.core.$strip>;
15
- type CohereLanguageModelOptions = z.infer<typeof cohereLanguageModelOptions>;
15
+ type CohereLanguageModelChatOptions = z.infer<typeof cohereLanguageModelChatOptions>;
16
16
 
17
17
  type CohereRerankingModelId = 'rerank-v3.5' | 'rerank-english-v3.0' | 'rerank-multilingual-v3.0' | (string & {});
18
18
  type CohereRerankingModelOptions = {
@@ -114,4 +114,4 @@ declare const cohere: CohereProvider;
114
114
 
115
115
  declare const VERSION: string;
116
116
 
117
- export { type CohereLanguageModelOptions as CohereChatModelOptions, type CohereEmbeddingModelOptions, type CohereLanguageModelOptions, type CohereProvider, type CohereProviderSettings, type CohereRerankingModelOptions, type CohereRerankingModelOptions as CohereRerankingOptions, VERSION, cohere, createCohere };
117
+ export { type CohereLanguageModelChatOptions as CohereChatModelOptions, type CohereEmbeddingModelOptions, type CohereLanguageModelChatOptions, type CohereLanguageModelChatOptions as CohereLanguageModelOptions, type CohereProvider, type CohereProviderSettings, type CohereRerankingModelOptions, type CohereRerankingModelOptions as CohereRerankingOptions, VERSION, cohere, createCohere };