@ai-sdk/mistral 4.0.0-beta.4 → 4.0.0-beta.55

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,418 @@
1
1
  # @ai-sdk/mistral
2
2
 
3
+ ## 4.0.0-beta.55
4
+
5
+ ### Patch Changes
6
+
7
+ - b8396f0: trigger initial beta release
8
+ - Updated dependencies [b8396f0]
9
+ - @ai-sdk/provider-utils@5.0.0-beta.49
10
+ - @ai-sdk/provider@4.0.0-beta.19
11
+
12
+ ## 4.0.0-canary.54
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies [aeda373]
17
+ - Updated dependencies [375fdd7]
18
+ - Updated dependencies [b4507d5]
19
+ - @ai-sdk/provider-utils@5.0.0-canary.48
20
+
21
+ ## 4.0.0-canary.53
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies [bae5e2b]
26
+ - @ai-sdk/provider-utils@5.0.0-canary.47
27
+
28
+ ## 4.0.0-canary.52
29
+
30
+ ### Patch Changes
31
+
32
+ - Updated dependencies [ce769dd]
33
+ - @ai-sdk/provider@4.0.0-canary.18
34
+ - @ai-sdk/provider-utils@5.0.0-canary.46
35
+
36
+ ## 4.0.0-canary.51
37
+
38
+ ### Patch Changes
39
+
40
+ - Updated dependencies [ee798eb]
41
+ - Updated dependencies [daf6637]
42
+ - @ai-sdk/provider-utils@5.0.0-canary.45
43
+
44
+ ## 4.0.0-canary.50
45
+
46
+ ### Patch Changes
47
+
48
+ - Updated dependencies [6c93e36]
49
+ - Updated dependencies [f617ac2]
50
+ - @ai-sdk/provider-utils@5.0.0-canary.44
51
+
52
+ ## 4.0.0-canary.49
53
+
54
+ ### Patch Changes
55
+
56
+ - 7fc6bd6: Raise minimum supported Node.js version to 22. Supported versions: 22, 24, and 26.
57
+ - Updated dependencies [7fc6bd6]
58
+ - @ai-sdk/provider-utils@5.0.0-canary.43
59
+ - @ai-sdk/provider@4.0.0-canary.17
60
+
61
+ ## 4.0.0-canary.48
62
+
63
+ ### Patch Changes
64
+
65
+ - Updated dependencies [a6617c5]
66
+ - @ai-sdk/provider-utils@5.0.0-canary.42
67
+
68
+ ## 4.0.0-canary.47
69
+
70
+ ### Patch Changes
71
+
72
+ - Updated dependencies [28dfa06]
73
+ - Updated dependencies [e93fa91]
74
+ - @ai-sdk/provider-utils@5.0.0-canary.41
75
+
76
+ ## 4.0.0-canary.46
77
+
78
+ ### Patch Changes
79
+
80
+ - Updated dependencies [a7de9c9]
81
+ - @ai-sdk/provider-utils@5.0.0-canary.40
82
+
83
+ ## 4.0.0-canary.45
84
+
85
+ ### Patch Changes
86
+
87
+ - Updated dependencies [105f95b]
88
+ - @ai-sdk/provider-utils@5.0.0-canary.39
89
+
90
+ ## 4.0.0-canary.44
91
+
92
+ ### Patch Changes
93
+
94
+ - 7acf358: fix(mistral): forward `stopSequences` as Mistral's native `stop` parameter
95
+
96
+ ## 4.0.0-canary.43
97
+
98
+ ### Patch Changes
99
+
100
+ - Updated dependencies [ca446f8]
101
+ - @ai-sdk/provider-utils@5.0.0-canary.38
102
+
103
+ ## 4.0.0-canary.42
104
+
105
+ ### Patch Changes
106
+
107
+ - Updated dependencies [d848405]
108
+ - @ai-sdk/provider-utils@5.0.0-canary.37
109
+
110
+ ## 4.0.0-canary.41
111
+
112
+ ### Patch Changes
113
+
114
+ - Updated dependencies [ca39020]
115
+ - @ai-sdk/provider-utils@5.0.0-canary.36
116
+
117
+ ## 4.0.0-canary.40
118
+
119
+ ### Patch Changes
120
+
121
+ - Updated dependencies [f634bac]
122
+ - @ai-sdk/provider-utils@5.0.0-canary.35
123
+
124
+ ## 4.0.0-canary.39
125
+
126
+ ### Patch Changes
127
+
128
+ - Updated dependencies [69254e0]
129
+ - Updated dependencies [3015fc3]
130
+ - @ai-sdk/provider-utils@5.0.0-canary.34
131
+
132
+ ## 4.0.0-canary.38
133
+
134
+ ### Patch Changes
135
+
136
+ - Updated dependencies [2427d88]
137
+ - @ai-sdk/provider-utils@5.0.0-canary.33
138
+
139
+ ## 4.0.0-canary.37
140
+
141
+ ### Patch Changes
142
+
143
+ - 5463d0d: feat(provider): align tool result output content file part types with top-level message file part types
144
+ - Updated dependencies [5463d0d]
145
+ - @ai-sdk/provider-utils@5.0.0-canary.32
146
+ - @ai-sdk/provider@4.0.0-canary.16
147
+
148
+ ## 4.0.0-canary.36
149
+
150
+ ### Patch Changes
151
+
152
+ - 3ae1d12: Add support for mistral-medium-3.5
153
+
154
+ ## 4.0.0-canary.35
155
+
156
+ ### Patch Changes
157
+
158
+ - 8abd80f: Map cached token counts from Mistral API usage response. Previously all prompt tokens were reported as noCacheTokens, ignoring the `num_cached_tokens`, `prompt_tokens_details.cached_tokens`, and `prompt_token_details.cached_tokens` fields returned by Mistral.
159
+
160
+ ## 4.0.0-canary.34
161
+
162
+ ### Patch Changes
163
+
164
+ - 0c4c275: trigger initial canary release
165
+ - Updated dependencies [0c4c275]
166
+ - @ai-sdk/provider-utils@5.0.0-canary.31
167
+ - @ai-sdk/provider@4.0.0-canary.15
168
+
169
+ ## 4.0.0-beta.33
170
+
171
+ ### Major Changes
172
+
173
+ - 04e9009: chore: make provider implementations code patterns more consistent, including renaming certain exported symbols
174
+
175
+ For all externally exported symbols that were renamed, the old names continue to work via deprecated aliases.
176
+
177
+ ### Patch Changes
178
+
179
+ - Updated dependencies [08d2129]
180
+ - @ai-sdk/provider-utils@5.0.0-beta.30
181
+
182
+ ## 4.0.0-beta.32
183
+
184
+ ### Patch Changes
185
+
186
+ - 9bd6512: feat(provider): change file part data property to be tagged with a type and remove the image part type
187
+ - 258c093: chore: ensure consistent import handling and avoid import duplicates or cycles
188
+ - Updated dependencies [9bd6512]
189
+ - Updated dependencies [258c093]
190
+ - Updated dependencies [b6783da]
191
+ - @ai-sdk/provider-utils@5.0.0-beta.29
192
+ - @ai-sdk/provider@4.0.0-beta.14
193
+
194
+ ## 4.0.0-beta.31
195
+
196
+ ### Patch Changes
197
+
198
+ - 9f0e36c: trigger release for all packages after provenance setup
199
+ - Updated dependencies [9f0e36c]
200
+ - @ai-sdk/provider@4.0.0-beta.13
201
+ - @ai-sdk/provider-utils@5.0.0-beta.28
202
+
203
+ ## 4.0.0-beta.30
204
+
205
+ ### Patch Changes
206
+
207
+ - 58a2ad7: fix: more precise default message for tool execution denial
208
+ - Updated dependencies [785fe16]
209
+ - Updated dependencies [67df0a0]
210
+ - Updated dependencies [befb78c]
211
+ - Updated dependencies [0458559]
212
+ - Updated dependencies [5852c0a]
213
+ - Updated dependencies [fc92055]
214
+ - @ai-sdk/provider-utils@5.0.0-beta.27
215
+
216
+ ## 4.0.0-beta.29
217
+
218
+ ### Patch Changes
219
+
220
+ - Updated dependencies [2e98477]
221
+ - @ai-sdk/provider-utils@5.0.0-beta.26
222
+
223
+ ## 4.0.0-beta.28
224
+
225
+ ### Patch Changes
226
+
227
+ - Updated dependencies [eea8d98]
228
+ - @ai-sdk/provider-utils@5.0.0-beta.25
229
+
230
+ ## 4.0.0-beta.27
231
+
232
+ ### Patch Changes
233
+
234
+ - Updated dependencies [f807e45]
235
+ - @ai-sdk/provider-utils@5.0.0-beta.24
236
+
237
+ ## 4.0.0-beta.26
238
+
239
+ ### Patch Changes
240
+
241
+ - Updated dependencies [350ea38]
242
+ - @ai-sdk/provider-utils@5.0.0-beta.23
243
+
244
+ ## 4.0.0-beta.25
245
+
246
+ ### Patch Changes
247
+
248
+ - Updated dependencies [083947b]
249
+ - @ai-sdk/provider-utils@5.0.0-beta.22
250
+
251
+ ## 4.0.0-beta.24
252
+
253
+ ### Patch Changes
254
+
255
+ - Updated dependencies [add1126]
256
+ - @ai-sdk/provider-utils@5.0.0-beta.21
257
+
258
+ ## 4.0.0-beta.23
259
+
260
+ ### Patch Changes
261
+
262
+ - b3976a2: Add workflow serialization support to all provider models.
263
+
264
+ **`@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.
265
+
266
+ **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.
267
+
268
+ All provider model classes now include `WORKFLOW_SERIALIZE` and `WORKFLOW_DESERIALIZE` static methods, enabling them to cross workflow step boundaries without serialization errors.
269
+
270
+ - ff5eba1: feat: roll `image-*` tool output types into their equivalent `file-*` types
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.22
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.21
289
+
290
+ ### Patch Changes
291
+
292
+ - Updated dependencies [90e2d8a]
293
+ - @ai-sdk/provider-utils@5.0.0-beta.18
294
+
295
+ ## 4.0.0-beta.20
296
+
297
+ ### Patch Changes
298
+
299
+ - Updated dependencies [3ae1786]
300
+ - @ai-sdk/provider-utils@5.0.0-beta.17
301
+
302
+ ## 4.0.0-beta.19
303
+
304
+ ### Patch Changes
305
+
306
+ - Updated dependencies [176466a]
307
+ - @ai-sdk/provider@4.0.0-beta.10
308
+ - @ai-sdk/provider-utils@5.0.0-beta.16
309
+
310
+ ## 4.0.0-beta.18
311
+
312
+ ### Patch Changes
313
+
314
+ - Updated dependencies [e311194]
315
+ - @ai-sdk/provider@4.0.0-beta.9
316
+ - @ai-sdk/provider-utils@5.0.0-beta.15
317
+
318
+ ## 4.0.0-beta.17
319
+
320
+ ### Patch Changes
321
+
322
+ - Updated dependencies [34bd95d]
323
+ - Updated dependencies [008271d]
324
+ - @ai-sdk/provider@4.0.0-beta.8
325
+ - @ai-sdk/provider-utils@5.0.0-beta.14
326
+
327
+ ## 4.0.0-beta.16
328
+
329
+ ### Patch Changes
330
+
331
+ - Updated dependencies [b0c2869]
332
+ - Updated dependencies [7e26e81]
333
+ - @ai-sdk/provider-utils@5.0.0-beta.13
334
+
335
+ ## 4.0.0-beta.15
336
+
337
+ ### Patch Changes
338
+
339
+ - Updated dependencies [46d1149]
340
+ - @ai-sdk/provider-utils@5.0.0-beta.12
341
+
342
+ ## 4.0.0-beta.14
343
+
344
+ ### Patch Changes
345
+
346
+ - Updated dependencies [6fd51c0]
347
+ - @ai-sdk/provider-utils@5.0.0-beta.11
348
+ - @ai-sdk/provider@4.0.0-beta.7
349
+
350
+ ## 4.0.0-beta.13
351
+
352
+ ### Patch Changes
353
+
354
+ - c29a26f: feat(provider): add support for provider references and uploading files as supported per provider
355
+ - Updated dependencies [c29a26f]
356
+ - @ai-sdk/provider-utils@5.0.0-beta.10
357
+ - @ai-sdk/provider@4.0.0-beta.6
358
+
359
+ ## 4.0.0-beta.12
360
+
361
+ ### Patch Changes
362
+
363
+ - 38fc777: Add AI Gateway hint to provider READMEs
364
+
365
+ ## 4.0.0-beta.11
366
+
367
+ ### Patch Changes
368
+
369
+ - Updated dependencies [2e17091]
370
+ - @ai-sdk/provider-utils@5.0.0-beta.9
371
+
372
+ ## 4.0.0-beta.10
373
+
374
+ ### Patch Changes
375
+
376
+ - Updated dependencies [986c6fd]
377
+ - Updated dependencies [493295c]
378
+ - @ai-sdk/provider-utils@5.0.0-beta.8
379
+
380
+ ## 4.0.0-beta.9
381
+
382
+ ### Patch Changes
383
+
384
+ - Updated dependencies [1f509d4]
385
+ - @ai-sdk/provider-utils@5.0.0-beta.7
386
+ - @ai-sdk/provider@4.0.0-beta.5
387
+
388
+ ## 4.0.0-beta.8
389
+
390
+ ### Patch Changes
391
+
392
+ - 737b8f4: feat(provider/mistral): add support for reasoning configuration (mistral-small-latest)
393
+
394
+ ## 4.0.0-beta.7
395
+
396
+ ### Patch Changes
397
+
398
+ - 5259a95: chore: add warning for providers that do not support new reasoning parameter
399
+
400
+ ## 4.0.0-beta.6
401
+
402
+ ### Patch Changes
403
+
404
+ - Updated dependencies [3887c70]
405
+ - @ai-sdk/provider-utils@5.0.0-beta.6
406
+ - @ai-sdk/provider@4.0.0-beta.4
407
+
408
+ ## 4.0.0-beta.5
409
+
410
+ ### Patch Changes
411
+
412
+ - Updated dependencies [776b617]
413
+ - @ai-sdk/provider-utils@5.0.0-beta.5
414
+ - @ai-sdk/provider@4.0.0-beta.3
415
+
3
416
  ## 4.0.0-beta.4
4
417
 
5
418
  ### Patch Changes
@@ -233,13 +646,13 @@
233
646
  Before
234
647
 
235
648
  ```ts
236
- model.textEmbeddingModel('my-model-id');
649
+ model.textEmbeddingModel("my-model-id");
237
650
  ```
238
651
 
239
652
  After
240
653
 
241
654
  ```ts
242
- model.embeddingModel('my-model-id');
655
+ model.embeddingModel("my-model-id");
243
656
  ```
244
657
 
245
658
  - 2625a04: feat(openai); update spec for mcp approval
@@ -454,13 +867,13 @@
454
867
  Before
455
868
 
456
869
  ```ts
457
- model.textEmbeddingModel('my-model-id');
870
+ model.textEmbeddingModel("my-model-id");
458
871
  ```
459
872
 
460
873
  After
461
874
 
462
875
  ```ts
463
- model.embeddingModel('my-model-id');
876
+ model.embeddingModel("my-model-id");
464
877
  ```
465
878
 
466
879
  - Updated dependencies [8d9e8ad]
@@ -810,12 +1223,12 @@
810
1223
  - 3429644: feat(provider/mistral): `MistralLanguageModelOptions` type
811
1224
 
812
1225
  ```ts
813
- import { mistral, type MistralLanguageModelOptions } from '@ai-sdk/mistral';
814
- import { generateText } from 'ai';
1226
+ import { mistral, type MistralLanguageModelOptions } from "@ai-sdk/mistral";
1227
+ import { generateText } from "ai";
815
1228
 
816
1229
  await generateText({
817
- model: mistral('open-mistral-7b'),
818
- prompt: 'Invent a new holiday and describe its traditions.',
1230
+ model: mistral("open-mistral-7b"),
1231
+ prompt: "Invent a new holiday and describe its traditions.",
819
1232
  providerOptions: {
820
1233
  mistral: {
821
1234
  safePrompt: true,
package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  The **[Mistral provider](https://ai-sdk.dev/providers/ai-sdk-providers/mistral)** for the [AI SDK](https://ai-sdk.dev/docs) contains language model support for the Mistral chat API.
4
4
 
5
+ > **Deploying to Vercel?** With Vercel's AI Gateway you can access Mistral (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 Mistral provider is available in the `@ai-sdk/mistral` module. You can install it with
package/dist/index.d.ts CHANGED
@@ -2,16 +2,20 @@ import { ProviderV4, LanguageModelV4, EmbeddingModelV4 } from '@ai-sdk/provider'
2
2
  import { FetchFunction } from '@ai-sdk/provider-utils';
3
3
  import { z } from 'zod/v4';
4
4
 
5
- type MistralChatModelId = 'ministral-3b-latest' | 'ministral-8b-latest' | 'mistral-large-latest' | 'mistral-medium-latest' | 'mistral-medium-2508' | 'mistral-medium-2505' | 'mistral-small-latest' | 'pixtral-large-latest' | 'magistral-small-2507' | 'magistral-medium-2507' | 'magistral-small-2506' | 'magistral-medium-2506' | 'pixtral-12b-2409' | 'open-mistral-7b' | 'open-mixtral-8x7b' | 'open-mixtral-8x22b' | (string & {});
6
- declare const mistralLanguageModelOptions: z.ZodObject<{
5
+ type MistralChatModelId = 'ministral-3b-latest' | 'ministral-8b-latest' | 'ministral-14b-latest' | 'mistral-large-latest' | 'mistral-medium-latest' | 'mistral-medium-3' | 'mistral-large-2512' | 'mistral-medium-2508' | 'mistral-medium-2505' | 'mistral-small-2506' | 'pixtral-large-latest' | 'mistral-medium-3.5' | 'mistral-small-latest' | 'mistral-small-2603' | 'magistral-medium-latest' | 'magistral-small-latest' | 'magistral-medium-2509' | 'magistral-small-2509' | (string & {});
6
+ declare const mistralLanguageModelChatOptions: z.ZodObject<{
7
7
  safePrompt: z.ZodOptional<z.ZodBoolean>;
8
8
  documentImageLimit: z.ZodOptional<z.ZodNumber>;
9
9
  documentPageLimit: z.ZodOptional<z.ZodNumber>;
10
10
  structuredOutputs: z.ZodOptional<z.ZodBoolean>;
11
11
  strictJsonSchema: z.ZodOptional<z.ZodBoolean>;
12
12
  parallelToolCalls: z.ZodOptional<z.ZodBoolean>;
13
+ reasoningEffort: z.ZodOptional<z.ZodEnum<{
14
+ none: "none";
15
+ high: "high";
16
+ }>>;
13
17
  }, z.core.$strip>;
14
- type MistralLanguageModelOptions = z.infer<typeof mistralLanguageModelOptions>;
18
+ type MistralLanguageModelChatOptions = z.infer<typeof mistralLanguageModelChatOptions>;
15
19
 
16
20
  type MistralEmbeddingModelId = 'mistral-embed' | (string & {});
17
21
 
@@ -75,4 +79,4 @@ declare const mistral: MistralProvider;
75
79
 
76
80
  declare const VERSION: string;
77
81
 
78
- export { type MistralLanguageModelOptions, type MistralProvider, type MistralProviderSettings, VERSION, createMistral, mistral };
82
+ export { type MistralLanguageModelChatOptions, type MistralLanguageModelChatOptions as MistralLanguageModelOptions, type MistralProvider, type MistralProviderSettings, VERSION, createMistral, mistral };