@ai-sdk/mistral 4.0.54 → 4.0.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,16 @@
1
1
  # @ai-sdk/mistral
2
2
 
3
+ ## 4.0.55
4
+
5
+ ### Patch Changes
6
+
7
+ - c636bb4: fix(mistral): map provider error finish reasons to error
8
+ - ede5b89: chore: migrate package builds from tsup to tsdown
9
+ - 5fa97cd: fix(mistral): preserve JSON schemas when structured outputs are disabled
10
+ - Updated dependencies [ede5b89]
11
+ - @ai-sdk/provider@4.0.20
12
+ - @ai-sdk/provider-utils@5.0.52
13
+
3
14
  ## 4.0.54
4
15
 
5
16
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1,128 +1,133 @@
1
- import { ProviderV4, LanguageModelV4, EmbeddingModelV4, SpeechModelV4, TranscriptionModelV4 } from '@ai-sdk/provider';
2
- import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
3
- import { InferSchema, FetchFunction } from '@ai-sdk/provider-utils';
4
- import { z } from 'zod/v4';
5
-
1
+ import { EmbeddingModelV4, LanguageModelV4, ProviderV4, SpeechModelV4, TranscriptionModelV4 } from "@ai-sdk/provider";
2
+ import { FetchFunction, InferSchema } from "@ai-sdk/provider-utils";
3
+ import { z } from "zod/v4";
4
+ //#region src/mistral-chat-language-model-options.d.ts
6
5
  type MistralChatModelId = 'codestral-2508' | 'codestral-latest' | 'glm-5-2' | 'labs-leanstral-1-5' | 'labs-leanstral-1-5-1' | 'magistral-medium-latest' | 'magistral-small-latest' | 'ministral-14b-2512' | 'ministral-14b-latest' | 'ministral-3b-2512' | 'ministral-3b-latest' | 'ministral-8b-2512' | 'ministral-8b-latest' | 'mistral-code-fim-latest' | 'mistral-code-latest' | 'mistral-large-latest' | 'mistral-large-2512' | 'mistral-medium' | 'mistral-medium-latest' | 'mistral-medium-2604' | 'mistral-medium-3' | 'mistral-medium-3-5' | 'mistral-medium-3.5' | 'mistral-small-2603' | 'mistral-small-latest' | 'mistral-vibe-cli-fast' | 'mistral-vibe-cli-latest' | 'mistral-vibe-cli-with-tools' | 'voxtral-small-2507' | 'voxtral-small-latest' | 'zai-glm-5-2' | (string & {});
7
6
  declare const mistralLanguageModelChatOptions: z.ZodObject<{
8
- safePrompt: z.ZodOptional<z.ZodBoolean>;
9
- documentImageLimit: z.ZodOptional<z.ZodNumber>;
10
- documentPageLimit: z.ZodOptional<z.ZodNumber>;
11
- structuredOutputs: z.ZodOptional<z.ZodBoolean>;
12
- strictJsonSchema: z.ZodOptional<z.ZodBoolean>;
13
- parallelToolCalls: z.ZodOptional<z.ZodBoolean>;
14
- promptCacheKey: z.ZodOptional<z.ZodString>;
15
- reasoningEffort: z.ZodOptional<z.ZodEnum<{
16
- none: "none";
17
- high: "high";
18
- }>>;
7
+ safePrompt: z.ZodOptional<z.ZodBoolean>;
8
+ documentImageLimit: z.ZodOptional<z.ZodNumber>;
9
+ documentPageLimit: z.ZodOptional<z.ZodNumber>;
10
+ structuredOutputs: z.ZodOptional<z.ZodBoolean>;
11
+ strictJsonSchema: z.ZodOptional<z.ZodBoolean>;
12
+ parallelToolCalls: z.ZodOptional<z.ZodBoolean>;
13
+ promptCacheKey: z.ZodOptional<z.ZodString>;
14
+ reasoningEffort: z.ZodOptional<z.ZodEnum<{
15
+ high: "high";
16
+ none: "none";
17
+ }>>;
19
18
  }, z.core.$strip>;
20
19
  type MistralLanguageModelChatOptions = z.infer<typeof mistralLanguageModelChatOptions>;
21
-
20
+ //#endregion
21
+ //#region src/mistral-embedding-model-options.d.ts
22
22
  type MistralEmbeddingModelId = 'mistral-embed' | 'mistral-embed-2312' | 'codestral-embed' | 'codestral-embed-2505' | (string & {});
23
23
  declare const mistralEmbeddingModelOptions: z.ZodObject<{
24
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
25
- outputDimension: z.ZodOptional<z.ZodNumber>;
26
- outputDtype: z.ZodOptional<z.ZodEnum<{
27
- float: "float";
28
- int8: "int8";
29
- uint8: "uint8";
30
- binary: "binary";
31
- ubinary: "ubinary";
32
- }>>;
24
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
25
+ outputDimension: z.ZodOptional<z.ZodNumber>;
26
+ outputDtype: z.ZodOptional<z.ZodEnum<{
27
+ float: "float";
28
+ int8: "int8";
29
+ uint8: "uint8";
30
+ binary: "binary";
31
+ ubinary: "ubinary";
32
+ }>>;
33
33
  }, z.core.$strip>;
34
34
  type MistralEmbeddingModelOptions = z.infer<typeof mistralEmbeddingModelOptions>;
35
-
35
+ //#endregion
36
+ //#region src/mistral-speech-model-options.d.ts
36
37
  type MistralSpeechModelId = 'voxtral-mini-tts-2603' | 'voxtral-mini-tts-latest' | (string & {});
37
38
  declare const mistralSpeechModelOptions: z.ZodObject<{
38
- refAudio: z.ZodOptional<z.ZodString>;
39
+ refAudio: z.ZodOptional<z.ZodString>;
39
40
  }, z.core.$strip>;
40
41
  type MistralSpeechModelOptions = z.infer<typeof mistralSpeechModelOptions>;
41
-
42
+ //#endregion
43
+ //#region src/mistral-transcription-model-options.d.ts
42
44
  type MistralTranscriptionModelId = 'voxtral-mini-2602' | 'voxtral-mini-latest' | (string & {});
43
- declare const mistralTranscriptionModelOptions: _ai_sdk_provider_utils.LazySchema<{
44
- language?: string | undefined;
45
- temperature?: number | undefined;
46
- timestampGranularities?: ("segment" | "word")[] | undefined;
47
- diarize?: boolean | undefined;
48
- contextBias?: string[] | undefined;
45
+ declare const mistralTranscriptionModelOptions: import("@ai-sdk/provider-utils").LazySchema<{
46
+ language?: string | undefined;
47
+ temperature?: number | undefined;
48
+ timestampGranularities?: ("segment" | "word")[] | undefined;
49
+ diarize?: boolean | undefined;
50
+ contextBias?: string[] | undefined;
49
51
  }>;
50
52
  type MistralTranscriptionModelOptions = InferSchema<typeof mistralTranscriptionModelOptions>;
51
-
53
+ //#endregion
54
+ //#region src/mistral-provider.d.ts
52
55
  interface MistralProvider extends ProviderV4 {
53
- (modelId: MistralChatModelId): LanguageModelV4;
54
- /**
55
- * Creates a model for text generation.
56
- */
57
- languageModel(modelId: MistralChatModelId): LanguageModelV4;
58
- /**
59
- * Creates a model for text generation.
60
- */
61
- chat(modelId: MistralChatModelId): LanguageModelV4;
62
- /**
63
- * Creates a model for text embeddings.
64
- */
65
- embedding(modelId: MistralEmbeddingModelId): EmbeddingModelV4;
66
- /**
67
- * Creates a model for text embeddings.
68
- */
69
- embeddingModel: (modelId: MistralEmbeddingModelId) => EmbeddingModelV4;
70
- /**
71
- * Creates a model for speech generation (text-to-speech).
72
- */
73
- speech(modelId: MistralSpeechModelId): SpeechModelV4;
74
- /**
75
- * Creates a model for speech generation (text-to-speech).
76
- */
77
- speechModel(modelId: MistralSpeechModelId): SpeechModelV4;
78
- /**
79
- * Creates a model for audio transcription.
80
- */
81
- transcription(modelId: MistralTranscriptionModelId): TranscriptionModelV4;
82
- /**
83
- * Creates a model for audio transcription.
84
- */
85
- transcriptionModel(modelId: MistralTranscriptionModelId): TranscriptionModelV4;
86
- /**
87
- * @deprecated Use `embedding` instead.
88
- */
89
- textEmbedding(modelId: MistralEmbeddingModelId): EmbeddingModelV4;
90
- /**
91
- * @deprecated Use `embeddingModel` instead.
92
- */
93
- textEmbeddingModel(modelId: MistralEmbeddingModelId): EmbeddingModelV4;
56
+ (modelId: MistralChatModelId): LanguageModelV4;
57
+ /**
58
+ * Creates a model for text generation.
59
+ */
60
+ languageModel(modelId: MistralChatModelId): LanguageModelV4;
61
+ /**
62
+ * Creates a model for text generation.
63
+ */
64
+ chat(modelId: MistralChatModelId): LanguageModelV4;
65
+ /**
66
+ * Creates a model for text embeddings.
67
+ */
68
+ embedding(modelId: MistralEmbeddingModelId): EmbeddingModelV4;
69
+ /**
70
+ * Creates a model for text embeddings.
71
+ */
72
+ embeddingModel: (modelId: MistralEmbeddingModelId) => EmbeddingModelV4;
73
+ /**
74
+ * Creates a model for speech generation (text-to-speech).
75
+ */
76
+ speech(modelId: MistralSpeechModelId): SpeechModelV4;
77
+ /**
78
+ * Creates a model for speech generation (text-to-speech).
79
+ */
80
+ speechModel(modelId: MistralSpeechModelId): SpeechModelV4;
81
+ /**
82
+ * Creates a model for audio transcription.
83
+ */
84
+ transcription(modelId: MistralTranscriptionModelId): TranscriptionModelV4;
85
+ /**
86
+ * Creates a model for audio transcription.
87
+ */
88
+ transcriptionModel(modelId: MistralTranscriptionModelId): TranscriptionModelV4;
89
+ /**
90
+ * @deprecated Use `embedding` instead.
91
+ */
92
+ textEmbedding(modelId: MistralEmbeddingModelId): EmbeddingModelV4;
93
+ /**
94
+ * @deprecated Use `embeddingModel` instead.
95
+ */
96
+ textEmbeddingModel(modelId: MistralEmbeddingModelId): EmbeddingModelV4;
94
97
  }
95
98
  interface MistralProviderSettings {
96
- /**
97
- * Use a different URL prefix for API calls, e.g. to use proxy servers.
98
- * The default prefix is `https://api.mistral.ai/v1`.
99
- */
100
- baseURL?: string;
101
- /**
102
- * API key that is being send using the `Authorization` header.
103
- * It defaults to the `MISTRAL_API_KEY` environment variable.
104
- */
105
- apiKey?: string;
106
- /**
107
- * Custom headers to include in the requests.
108
- */
109
- headers?: Record<string, string>;
110
- /**
111
- * Custom fetch implementation. You can use it as a middleware to intercept requests,
112
- * or to provide a custom fetch implementation for e.g. testing.
113
- */
114
- fetch?: FetchFunction;
115
- generateId?: () => string;
99
+ /**
100
+ * Use a different URL prefix for API calls, e.g. to use proxy servers.
101
+ * The default prefix is `https://api.mistral.ai/v1`.
102
+ */
103
+ baseURL?: string;
104
+ /**
105
+ * API key that is being send using the `Authorization` header.
106
+ * It defaults to the `MISTRAL_API_KEY` environment variable.
107
+ */
108
+ apiKey?: string;
109
+ /**
110
+ * Custom headers to include in the requests.
111
+ */
112
+ headers?: Record<string, string>;
113
+ /**
114
+ * Custom fetch implementation. You can use it as a middleware to intercept requests,
115
+ * or to provide a custom fetch implementation for e.g. testing.
116
+ */
117
+ fetch?: FetchFunction;
118
+ generateId?: () => string;
116
119
  }
117
120
  /**
118
121
  * Create a Mistral AI provider instance.
119
122
  */
120
- declare function createMistral(options?: MistralProviderSettings): MistralProvider;
123
+ export declare function createMistral(options?: MistralProviderSettings): MistralProvider;
121
124
  /**
122
125
  * Default Mistral provider instance.
123
126
  */
124
- declare const mistral: MistralProvider;
125
-
126
- declare const VERSION: string;
127
-
128
- export { type MistralEmbeddingModelOptions, type MistralLanguageModelChatOptions, type MistralLanguageModelChatOptions as MistralLanguageModelOptions, type MistralProvider, type MistralProviderSettings, type MistralSpeechModelId, type MistralSpeechModelOptions, type MistralTranscriptionModelId, type MistralTranscriptionModelOptions, VERSION, createMistral, mistral };
127
+ export declare const mistral: MistralProvider;
128
+ //#endregion
129
+ //#region src/version.d.ts
130
+ export declare const VERSION: string;
131
+ //#endregion
132
+ export type { MistralEmbeddingModelOptions, MistralLanguageModelChatOptions, MistralLanguageModelChatOptions as MistralLanguageModelOptions, MistralProvider, MistralProviderSettings, MistralSpeechModelId, MistralSpeechModelOptions, MistralTranscriptionModelId, MistralTranscriptionModelOptions };
133
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/mistral-chat-language-model-options.ts","../src/mistral-embedding-model-options.ts","../src/mistral-speech-model-options.ts","../src/mistral-transcription-model-options.ts","../src/mistral-provider.ts","../src/version.ts"],"mappings":";;;;KAGY;cAkCC,iCAA+B,EAAA;;;;;;;;;;;;GA8C1C,EAAA,KAAA;KAEU,kCAAkC,EAAE,aACvC;;;KCpFG;cAOC,8BAA4B,EAAA;;;;;;;;;;GAiBvC,EAAA,KAAA;KAEU,+BAA+B,EAAE,aACpC;;;KC3BG;cAKC,2BAAyB,EAAA;;GAOpC,EAAA,KAAA;KAEU,4BAA4B,EAAE,aACjC;;;KCVG;cAMC,mEAAgC;;;;;;;KAkDjC,mCAAmC,mBACtC;;;UCxCQ,wBAAwB;GACtC,SAAS,qBAAqB;;;;EAK/B,cAAc,SAAS,qBAAqB;;;;EAK5C,KAAK,SAAS,qBAAqB;;;;EAKnC,UAAU,SAAS,0BAA0B;;;;EAK7C,iBAAiB,SAAS,4BAA4B;;;;EAKtD,OAAO,SAAS,uBAAuB;;;;EAKvC,YAAY,SAAS,uBAAuB;;;;EAK5C,cAAc,SAAS,8BAA8B;;;;EAKrD,mBACE,SAAS,8BACR;;;;EAKH,cAAc,SAAS,0BAA0B;;;;EAKjD,mBAAmB,SAAS,0BAA0B;;UAGvC;;;;;EAKf;;;;;EAMA;;;;EAKA,UAAU;;;;;EAMV,QAAQ;EAER;;;;;wBAMc,cACd,UAAS,0BACR;;;;qBAkFU,SAAO;;;qBChMP"}