@ai-sdk/mistral 4.0.0-beta.2 → 4.0.0-beta.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 +144 -8
- package/README.md +2 -0
- package/dist/index.d.mts +14 -10
- package/dist/index.d.ts +14 -10
- package/dist/index.js +44 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +47 -10
- package/dist/index.mjs.map +1 -1
- package/docs/20-mistral.mdx +21 -0
- package/package.json +3 -5
- package/src/convert-mistral-usage.ts +2 -2
- package/src/convert-to-mistral-chat-messages.ts +11 -5
- package/src/map-mistral-finish-reason.ts +2 -2
- package/src/mistral-chat-language-model.ts +54 -19
- package/src/mistral-chat-options.ts +18 -12
- package/src/mistral-embedding-model.ts +5 -5
- package/src/mistral-prepare-tools.ts +6 -6
- package/src/mistral-provider.ts +12 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,141 @@
|
|
|
1
1
|
# @ai-sdk/mistral
|
|
2
2
|
|
|
3
|
+
## 4.0.0-beta.20
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [3ae1786]
|
|
8
|
+
- @ai-sdk/provider-utils@5.0.0-beta.17
|
|
9
|
+
|
|
10
|
+
## 4.0.0-beta.19
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [176466a]
|
|
15
|
+
- @ai-sdk/provider@4.0.0-beta.10
|
|
16
|
+
- @ai-sdk/provider-utils@5.0.0-beta.16
|
|
17
|
+
|
|
18
|
+
## 4.0.0-beta.18
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [e311194]
|
|
23
|
+
- @ai-sdk/provider@4.0.0-beta.9
|
|
24
|
+
- @ai-sdk/provider-utils@5.0.0-beta.15
|
|
25
|
+
|
|
26
|
+
## 4.0.0-beta.17
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- Updated dependencies [34bd95d]
|
|
31
|
+
- Updated dependencies [008271d]
|
|
32
|
+
- @ai-sdk/provider@4.0.0-beta.8
|
|
33
|
+
- @ai-sdk/provider-utils@5.0.0-beta.14
|
|
34
|
+
|
|
35
|
+
## 4.0.0-beta.16
|
|
36
|
+
|
|
37
|
+
### Patch Changes
|
|
38
|
+
|
|
39
|
+
- Updated dependencies [b0c2869]
|
|
40
|
+
- Updated dependencies [7e26e81]
|
|
41
|
+
- @ai-sdk/provider-utils@5.0.0-beta.13
|
|
42
|
+
|
|
43
|
+
## 4.0.0-beta.15
|
|
44
|
+
|
|
45
|
+
### Patch Changes
|
|
46
|
+
|
|
47
|
+
- Updated dependencies [46d1149]
|
|
48
|
+
- @ai-sdk/provider-utils@5.0.0-beta.12
|
|
49
|
+
|
|
50
|
+
## 4.0.0-beta.14
|
|
51
|
+
|
|
52
|
+
### Patch Changes
|
|
53
|
+
|
|
54
|
+
- Updated dependencies [6fd51c0]
|
|
55
|
+
- @ai-sdk/provider-utils@5.0.0-beta.11
|
|
56
|
+
- @ai-sdk/provider@4.0.0-beta.7
|
|
57
|
+
|
|
58
|
+
## 4.0.0-beta.13
|
|
59
|
+
|
|
60
|
+
### Patch Changes
|
|
61
|
+
|
|
62
|
+
- c29a26f: feat(provider): add support for provider references and uploading files as supported per provider
|
|
63
|
+
- Updated dependencies [c29a26f]
|
|
64
|
+
- @ai-sdk/provider-utils@5.0.0-beta.10
|
|
65
|
+
- @ai-sdk/provider@4.0.0-beta.6
|
|
66
|
+
|
|
67
|
+
## 4.0.0-beta.12
|
|
68
|
+
|
|
69
|
+
### Patch Changes
|
|
70
|
+
|
|
71
|
+
- 38fc777: Add AI Gateway hint to provider READMEs
|
|
72
|
+
|
|
73
|
+
## 4.0.0-beta.11
|
|
74
|
+
|
|
75
|
+
### Patch Changes
|
|
76
|
+
|
|
77
|
+
- Updated dependencies [2e17091]
|
|
78
|
+
- @ai-sdk/provider-utils@5.0.0-beta.9
|
|
79
|
+
|
|
80
|
+
## 4.0.0-beta.10
|
|
81
|
+
|
|
82
|
+
### Patch Changes
|
|
83
|
+
|
|
84
|
+
- Updated dependencies [986c6fd]
|
|
85
|
+
- Updated dependencies [493295c]
|
|
86
|
+
- @ai-sdk/provider-utils@5.0.0-beta.8
|
|
87
|
+
|
|
88
|
+
## 4.0.0-beta.9
|
|
89
|
+
|
|
90
|
+
### Patch Changes
|
|
91
|
+
|
|
92
|
+
- Updated dependencies [1f509d4]
|
|
93
|
+
- @ai-sdk/provider-utils@5.0.0-beta.7
|
|
94
|
+
- @ai-sdk/provider@4.0.0-beta.5
|
|
95
|
+
|
|
96
|
+
## 4.0.0-beta.8
|
|
97
|
+
|
|
98
|
+
### Patch Changes
|
|
99
|
+
|
|
100
|
+
- 737b8f4: feat(provider/mistral): add support for reasoning configuration (mistral-small-latest)
|
|
101
|
+
|
|
102
|
+
## 4.0.0-beta.7
|
|
103
|
+
|
|
104
|
+
### Patch Changes
|
|
105
|
+
|
|
106
|
+
- 5259a95: chore: add warning for providers that do not support new reasoning parameter
|
|
107
|
+
|
|
108
|
+
## 4.0.0-beta.6
|
|
109
|
+
|
|
110
|
+
### Patch Changes
|
|
111
|
+
|
|
112
|
+
- Updated dependencies [3887c70]
|
|
113
|
+
- @ai-sdk/provider-utils@5.0.0-beta.6
|
|
114
|
+
- @ai-sdk/provider@4.0.0-beta.4
|
|
115
|
+
|
|
116
|
+
## 4.0.0-beta.5
|
|
117
|
+
|
|
118
|
+
### Patch Changes
|
|
119
|
+
|
|
120
|
+
- Updated dependencies [776b617]
|
|
121
|
+
- @ai-sdk/provider-utils@5.0.0-beta.5
|
|
122
|
+
- @ai-sdk/provider@4.0.0-beta.3
|
|
123
|
+
|
|
124
|
+
## 4.0.0-beta.4
|
|
125
|
+
|
|
126
|
+
### Patch Changes
|
|
127
|
+
|
|
128
|
+
- Updated dependencies [61753c3]
|
|
129
|
+
- @ai-sdk/provider-utils@5.0.0-beta.4
|
|
130
|
+
|
|
131
|
+
## 4.0.0-beta.3
|
|
132
|
+
|
|
133
|
+
### Patch Changes
|
|
134
|
+
|
|
135
|
+
- Updated dependencies [f7d4f01]
|
|
136
|
+
- @ai-sdk/provider-utils@5.0.0-beta.3
|
|
137
|
+
- @ai-sdk/provider@4.0.0-beta.2
|
|
138
|
+
|
|
3
139
|
## 4.0.0-beta.2
|
|
4
140
|
|
|
5
141
|
### Patch Changes
|
|
@@ -218,13 +354,13 @@
|
|
|
218
354
|
Before
|
|
219
355
|
|
|
220
356
|
```ts
|
|
221
|
-
model.textEmbeddingModel(
|
|
357
|
+
model.textEmbeddingModel("my-model-id");
|
|
222
358
|
```
|
|
223
359
|
|
|
224
360
|
After
|
|
225
361
|
|
|
226
362
|
```ts
|
|
227
|
-
model.embeddingModel(
|
|
363
|
+
model.embeddingModel("my-model-id");
|
|
228
364
|
```
|
|
229
365
|
|
|
230
366
|
- 2625a04: feat(openai); update spec for mcp approval
|
|
@@ -439,13 +575,13 @@
|
|
|
439
575
|
Before
|
|
440
576
|
|
|
441
577
|
```ts
|
|
442
|
-
model.textEmbeddingModel(
|
|
578
|
+
model.textEmbeddingModel("my-model-id");
|
|
443
579
|
```
|
|
444
580
|
|
|
445
581
|
After
|
|
446
582
|
|
|
447
583
|
```ts
|
|
448
|
-
model.embeddingModel(
|
|
584
|
+
model.embeddingModel("my-model-id");
|
|
449
585
|
```
|
|
450
586
|
|
|
451
587
|
- Updated dependencies [8d9e8ad]
|
|
@@ -795,12 +931,12 @@
|
|
|
795
931
|
- 3429644: feat(provider/mistral): `MistralLanguageModelOptions` type
|
|
796
932
|
|
|
797
933
|
```ts
|
|
798
|
-
import { mistral, type MistralLanguageModelOptions } from
|
|
799
|
-
import { generateText } from
|
|
934
|
+
import { mistral, type MistralLanguageModelOptions } from "@ai-sdk/mistral";
|
|
935
|
+
import { generateText } from "ai";
|
|
800
936
|
|
|
801
937
|
await generateText({
|
|
802
|
-
model: mistral(
|
|
803
|
-
prompt:
|
|
938
|
+
model: mistral("open-mistral-7b"),
|
|
939
|
+
prompt: "Invent a new holiday and describe its traditions.",
|
|
804
940
|
providerOptions: {
|
|
805
941
|
mistral: {
|
|
806
942
|
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.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
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' | '
|
|
5
|
+
type MistralChatModelId = 'ministral-3b-latest' | 'ministral-8b-latest' | 'ministral-14b-latest' | 'mistral-large-latest' | 'mistral-medium-latest' | 'mistral-large-2512' | 'mistral-medium-2508' | 'mistral-medium-2505' | 'mistral-small-2506' | 'pixtral-large-latest' | 'mistral-small-latest' | 'mistral-small-2603' | 'magistral-medium-latest' | 'magistral-small-latest' | 'magistral-medium-2509' | 'magistral-small-2509' | (string & {});
|
|
6
6
|
declare const mistralLanguageModelOptions: z.ZodObject<{
|
|
7
7
|
safePrompt: z.ZodOptional<z.ZodBoolean>;
|
|
8
8
|
documentImageLimit: z.ZodOptional<z.ZodNumber>;
|
|
@@ -10,37 +10,41 @@ declare const mistralLanguageModelOptions: z.ZodObject<{
|
|
|
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
18
|
type MistralLanguageModelOptions = z.infer<typeof mistralLanguageModelOptions>;
|
|
15
19
|
|
|
16
20
|
type MistralEmbeddingModelId = 'mistral-embed' | (string & {});
|
|
17
21
|
|
|
18
|
-
interface MistralProvider extends
|
|
19
|
-
(modelId: MistralChatModelId):
|
|
22
|
+
interface MistralProvider extends ProviderV4 {
|
|
23
|
+
(modelId: MistralChatModelId): LanguageModelV4;
|
|
20
24
|
/**
|
|
21
25
|
* Creates a model for text generation.
|
|
22
26
|
*/
|
|
23
|
-
languageModel(modelId: MistralChatModelId):
|
|
27
|
+
languageModel(modelId: MistralChatModelId): LanguageModelV4;
|
|
24
28
|
/**
|
|
25
29
|
* Creates a model for text generation.
|
|
26
30
|
*/
|
|
27
|
-
chat(modelId: MistralChatModelId):
|
|
31
|
+
chat(modelId: MistralChatModelId): LanguageModelV4;
|
|
28
32
|
/**
|
|
29
33
|
* Creates a model for text embeddings.
|
|
30
34
|
*/
|
|
31
|
-
embedding(modelId: MistralEmbeddingModelId):
|
|
35
|
+
embedding(modelId: MistralEmbeddingModelId): EmbeddingModelV4;
|
|
32
36
|
/**
|
|
33
37
|
* Creates a model for text embeddings.
|
|
34
38
|
*/
|
|
35
|
-
embeddingModel: (modelId: MistralEmbeddingModelId) =>
|
|
39
|
+
embeddingModel: (modelId: MistralEmbeddingModelId) => EmbeddingModelV4;
|
|
36
40
|
/**
|
|
37
41
|
* @deprecated Use `embedding` instead.
|
|
38
42
|
*/
|
|
39
|
-
textEmbedding(modelId: MistralEmbeddingModelId):
|
|
43
|
+
textEmbedding(modelId: MistralEmbeddingModelId): EmbeddingModelV4;
|
|
40
44
|
/**
|
|
41
45
|
* @deprecated Use `embeddingModel` instead.
|
|
42
46
|
*/
|
|
43
|
-
textEmbeddingModel(modelId: MistralEmbeddingModelId):
|
|
47
|
+
textEmbeddingModel(modelId: MistralEmbeddingModelId): EmbeddingModelV4;
|
|
44
48
|
}
|
|
45
49
|
interface MistralProviderSettings {
|
|
46
50
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
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' | '
|
|
5
|
+
type MistralChatModelId = 'ministral-3b-latest' | 'ministral-8b-latest' | 'ministral-14b-latest' | 'mistral-large-latest' | 'mistral-medium-latest' | 'mistral-large-2512' | 'mistral-medium-2508' | 'mistral-medium-2505' | 'mistral-small-2506' | 'pixtral-large-latest' | 'mistral-small-latest' | 'mistral-small-2603' | 'magistral-medium-latest' | 'magistral-small-latest' | 'magistral-medium-2509' | 'magistral-small-2509' | (string & {});
|
|
6
6
|
declare const mistralLanguageModelOptions: z.ZodObject<{
|
|
7
7
|
safePrompt: z.ZodOptional<z.ZodBoolean>;
|
|
8
8
|
documentImageLimit: z.ZodOptional<z.ZodNumber>;
|
|
@@ -10,37 +10,41 @@ declare const mistralLanguageModelOptions: z.ZodObject<{
|
|
|
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
18
|
type MistralLanguageModelOptions = z.infer<typeof mistralLanguageModelOptions>;
|
|
15
19
|
|
|
16
20
|
type MistralEmbeddingModelId = 'mistral-embed' | (string & {});
|
|
17
21
|
|
|
18
|
-
interface MistralProvider extends
|
|
19
|
-
(modelId: MistralChatModelId):
|
|
22
|
+
interface MistralProvider extends ProviderV4 {
|
|
23
|
+
(modelId: MistralChatModelId): LanguageModelV4;
|
|
20
24
|
/**
|
|
21
25
|
* Creates a model for text generation.
|
|
22
26
|
*/
|
|
23
|
-
languageModel(modelId: MistralChatModelId):
|
|
27
|
+
languageModel(modelId: MistralChatModelId): LanguageModelV4;
|
|
24
28
|
/**
|
|
25
29
|
* Creates a model for text generation.
|
|
26
30
|
*/
|
|
27
|
-
chat(modelId: MistralChatModelId):
|
|
31
|
+
chat(modelId: MistralChatModelId): LanguageModelV4;
|
|
28
32
|
/**
|
|
29
33
|
* Creates a model for text embeddings.
|
|
30
34
|
*/
|
|
31
|
-
embedding(modelId: MistralEmbeddingModelId):
|
|
35
|
+
embedding(modelId: MistralEmbeddingModelId): EmbeddingModelV4;
|
|
32
36
|
/**
|
|
33
37
|
* Creates a model for text embeddings.
|
|
34
38
|
*/
|
|
35
|
-
embeddingModel: (modelId: MistralEmbeddingModelId) =>
|
|
39
|
+
embeddingModel: (modelId: MistralEmbeddingModelId) => EmbeddingModelV4;
|
|
36
40
|
/**
|
|
37
41
|
* @deprecated Use `embedding` instead.
|
|
38
42
|
*/
|
|
39
|
-
textEmbedding(modelId: MistralEmbeddingModelId):
|
|
43
|
+
textEmbedding(modelId: MistralEmbeddingModelId): EmbeddingModelV4;
|
|
40
44
|
/**
|
|
41
45
|
* @deprecated Use `embeddingModel` instead.
|
|
42
46
|
*/
|
|
43
|
-
textEmbeddingModel(modelId: MistralEmbeddingModelId):
|
|
47
|
+
textEmbeddingModel(modelId: MistralEmbeddingModelId): EmbeddingModelV4;
|
|
44
48
|
}
|
|
45
49
|
interface MistralProviderSettings {
|
|
46
50
|
/**
|
package/dist/index.js
CHANGED
|
@@ -99,6 +99,11 @@ function convertToMistralChatMessages(prompt) {
|
|
|
99
99
|
return { type: "text", text: part.text };
|
|
100
100
|
}
|
|
101
101
|
case "file": {
|
|
102
|
+
if ((0, import_provider_utils.isProviderReference)(part.data)) {
|
|
103
|
+
throw new import_provider.UnsupportedFunctionalityError({
|
|
104
|
+
functionality: "file parts with provider references"
|
|
105
|
+
});
|
|
106
|
+
}
|
|
102
107
|
if (part.mediaType.startsWith("image/")) {
|
|
103
108
|
const mediaType = part.mediaType === "image/*" ? "image/jpeg" : part.mediaType;
|
|
104
109
|
return {
|
|
@@ -259,7 +264,14 @@ var mistralLanguageModelOptions = import_v4.z.object({
|
|
|
259
264
|
*
|
|
260
265
|
* @default true
|
|
261
266
|
*/
|
|
262
|
-
parallelToolCalls: import_v4.z.boolean().optional()
|
|
267
|
+
parallelToolCalls: import_v4.z.boolean().optional(),
|
|
268
|
+
/**
|
|
269
|
+
* Controls the reasoning effort for models that support adjustable reasoning.
|
|
270
|
+
*
|
|
271
|
+
* - `'high'`: Enable reasoning
|
|
272
|
+
* - `'none'`: Disable reasoning
|
|
273
|
+
*/
|
|
274
|
+
reasoningEffort: import_v4.z.enum(["high", "none"]).optional()
|
|
263
275
|
});
|
|
264
276
|
|
|
265
277
|
// src/mistral-error.ts
|
|
@@ -339,7 +351,7 @@ function prepareTools({
|
|
|
339
351
|
// src/mistral-chat-language-model.ts
|
|
340
352
|
var MistralChatLanguageModel = class {
|
|
341
353
|
constructor(modelId, config) {
|
|
342
|
-
this.specificationVersion = "
|
|
354
|
+
this.specificationVersion = "v4";
|
|
343
355
|
this.supportedUrls = {
|
|
344
356
|
"application/pdf": [/^https:\/\/.*$/]
|
|
345
357
|
};
|
|
@@ -359,6 +371,7 @@ var MistralChatLanguageModel = class {
|
|
|
359
371
|
topK,
|
|
360
372
|
frequencyPenalty,
|
|
361
373
|
presencePenalty,
|
|
374
|
+
reasoning,
|
|
362
375
|
stopSequences,
|
|
363
376
|
responseFormat,
|
|
364
377
|
seed,
|
|
@@ -366,7 +379,7 @@ var MistralChatLanguageModel = class {
|
|
|
366
379
|
tools,
|
|
367
380
|
toolChoice
|
|
368
381
|
}) {
|
|
369
|
-
var _a, _b, _c, _d;
|
|
382
|
+
var _a, _b, _c, _d, _e;
|
|
370
383
|
const warnings = [];
|
|
371
384
|
const options = (_a = await (0, import_provider_utils3.parseProviderOptions)({
|
|
372
385
|
provider: "mistral",
|
|
@@ -385,8 +398,29 @@ var MistralChatLanguageModel = class {
|
|
|
385
398
|
if (stopSequences != null) {
|
|
386
399
|
warnings.push({ type: "unsupported", feature: "stopSequences" });
|
|
387
400
|
}
|
|
388
|
-
const
|
|
389
|
-
|
|
401
|
+
const supportsReasoningEffort = this.modelId === "mistral-small-latest" || this.modelId === "mistral-small-2603";
|
|
402
|
+
let resolvedReasoningEffort;
|
|
403
|
+
if (supportsReasoningEffort) {
|
|
404
|
+
resolvedReasoningEffort = (_b = options.reasoningEffort) != null ? _b : (0, import_provider_utils3.isCustomReasoning)(reasoning) ? reasoning === "none" ? "none" : (0, import_provider_utils3.mapReasoningToProviderEffort)({
|
|
405
|
+
reasoning,
|
|
406
|
+
effortMap: {
|
|
407
|
+
minimal: "high",
|
|
408
|
+
low: "high",
|
|
409
|
+
medium: "high",
|
|
410
|
+
high: "high",
|
|
411
|
+
xhigh: "high"
|
|
412
|
+
},
|
|
413
|
+
warnings
|
|
414
|
+
}) : void 0;
|
|
415
|
+
} else if ((0, import_provider_utils3.isCustomReasoning)(reasoning)) {
|
|
416
|
+
warnings.push({
|
|
417
|
+
type: "unsupported",
|
|
418
|
+
feature: "reasoning",
|
|
419
|
+
details: "This model does not support reasoning configuration."
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
const structuredOutputs = (_c = options.structuredOutputs) != null ? _c : true;
|
|
423
|
+
const strictJsonSchema = (_d = options.strictJsonSchema) != null ? _d : false;
|
|
390
424
|
if ((responseFormat == null ? void 0 : responseFormat.type) === "json" && !(responseFormat == null ? void 0 : responseFormat.schema)) {
|
|
391
425
|
prompt = (0, import_provider_utils3.injectJsonInstructionIntoMessages)({
|
|
392
426
|
messages: prompt,
|
|
@@ -403,13 +437,14 @@ var MistralChatLanguageModel = class {
|
|
|
403
437
|
temperature,
|
|
404
438
|
top_p: topP,
|
|
405
439
|
random_seed: seed,
|
|
440
|
+
reasoning_effort: resolvedReasoningEffort,
|
|
406
441
|
// response format:
|
|
407
442
|
response_format: (responseFormat == null ? void 0 : responseFormat.type) === "json" ? structuredOutputs && (responseFormat == null ? void 0 : responseFormat.schema) != null ? {
|
|
408
443
|
type: "json_schema",
|
|
409
444
|
json_schema: {
|
|
410
445
|
schema: responseFormat.schema,
|
|
411
446
|
strict: strictJsonSchema,
|
|
412
|
-
name: (
|
|
447
|
+
name: (_e = responseFormat.name) != null ? _e : "response",
|
|
413
448
|
description: responseFormat.description
|
|
414
449
|
}
|
|
415
450
|
} : { type: "json_object" } : void 0,
|
|
@@ -773,7 +808,7 @@ var import_provider_utils4 = require("@ai-sdk/provider-utils");
|
|
|
773
808
|
var import_v44 = require("zod/v4");
|
|
774
809
|
var MistralEmbeddingModel = class {
|
|
775
810
|
constructor(modelId, config) {
|
|
776
|
-
this.specificationVersion = "
|
|
811
|
+
this.specificationVersion = "v4";
|
|
777
812
|
this.maxEmbeddingsPerCall = 32;
|
|
778
813
|
this.supportsParallelCalls = false;
|
|
779
814
|
this.modelId = modelId;
|
|
@@ -828,7 +863,7 @@ var MistralTextEmbeddingResponseSchema = import_v44.z.object({
|
|
|
828
863
|
});
|
|
829
864
|
|
|
830
865
|
// src/version.ts
|
|
831
|
-
var VERSION = true ? "4.0.0-beta.
|
|
866
|
+
var VERSION = true ? "4.0.0-beta.20" : "0.0.0-test";
|
|
832
867
|
|
|
833
868
|
// src/mistral-provider.ts
|
|
834
869
|
function createMistral(options = {}) {
|
|
@@ -866,7 +901,7 @@ function createMistral(options = {}) {
|
|
|
866
901
|
}
|
|
867
902
|
return createChatModel(modelId);
|
|
868
903
|
};
|
|
869
|
-
provider.specificationVersion = "
|
|
904
|
+
provider.specificationVersion = "v4";
|
|
870
905
|
provider.languageModel = createChatModel;
|
|
871
906
|
provider.chat = createChatModel;
|
|
872
907
|
provider.embedding = createEmbeddingModel;
|