@tanstack/ai-mistral 0.3.4 → 0.4.1

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.
Files changed (42) hide show
  1. package/dist/esm/adapters/text.d.ts +4 -4
  2. package/dist/esm/adapters/text.js +18 -14
  3. package/dist/esm/adapters/text.js.map +1 -1
  4. package/dist/esm/index.d.ts +2 -2
  5. package/dist/esm/index.js +2 -2
  6. package/dist/esm/model-meta.d.ts +71 -0
  7. package/dist/esm/model-meta.js +335 -242
  8. package/dist/esm/model-meta.js.map +1 -1
  9. package/dist/esm/tools/function-tool.d.ts +4 -5
  10. package/dist/esm/tools/function-tool.js +7 -8
  11. package/dist/esm/tools/function-tool.js.map +1 -1
  12. package/dist/esm/tools/function-tool.test.d.ts +1 -0
  13. package/dist/esm/utils/client.d.ts +12 -0
  14. package/dist/esm/utils/client.js +9 -5
  15. package/dist/esm/utils/client.js.map +1 -1
  16. package/dist/esm/utils/schema-converter.d.ts +15 -15
  17. package/dist/esm/utils/schema-converter.js +173 -50
  18. package/dist/esm/utils/schema-converter.js.map +1 -1
  19. package/dist/esm/utils/schema-converter.test.d.ts +1 -0
  20. package/dist/esm/utils/tool-input-normalizer.d.ts +8 -0
  21. package/dist/esm/utils/tool-input-normalizer.js +34 -0
  22. package/dist/esm/utils/tool-input-normalizer.js.map +1 -0
  23. package/dist/esm/utils/tool-input-normalizer.test.d.ts +1 -0
  24. package/dist/esm/vertex/auth.d.ts +29 -0
  25. package/dist/esm/vertex/auth.js +62 -0
  26. package/dist/esm/vertex/auth.js.map +1 -0
  27. package/dist/esm/vertex/index.d.ts +12 -0
  28. package/dist/esm/vertex/index.js +26 -0
  29. package/dist/esm/vertex/index.js.map +1 -0
  30. package/package.json +16 -4
  31. package/src/adapters/text.ts +48 -28
  32. package/src/index.ts +6 -1
  33. package/src/model-meta.ts +70 -0
  34. package/src/tools/function-tool.test.ts +32 -0
  35. package/src/tools/function-tool.ts +11 -11
  36. package/src/utils/client.ts +41 -6
  37. package/src/utils/schema-converter.test.ts +256 -0
  38. package/src/utils/schema-converter.ts +251 -88
  39. package/src/utils/tool-input-normalizer.test.ts +50 -0
  40. package/src/utils/tool-input-normalizer.ts +42 -0
  41. package/src/vertex/auth.ts +154 -0
  42. package/src/vertex/index.ts +50 -0
@@ -1,254 +1,347 @@
1
+ //#region src/model-meta.ts
2
+ var MISTRAL_LARGE_LATEST = {
3
+ name: "mistral-large-latest",
4
+ context_window: 131072,
5
+ max_completion_tokens: 8192,
6
+ pricing: {
7
+ input: { normal: .5 },
8
+ output: { normal: 1.5 }
9
+ },
10
+ supports: {
11
+ input: ["text"],
12
+ output: ["text"],
13
+ endpoints: ["chat"],
14
+ features: [
15
+ "streaming",
16
+ "tools",
17
+ "json_object",
18
+ "json_schema"
19
+ ]
20
+ }
21
+ };
22
+ var MISTRAL_MEDIUM_LATEST = {
23
+ name: "mistral-medium-latest",
24
+ context_window: 131072,
25
+ max_completion_tokens: 8192,
26
+ pricing: {
27
+ input: { normal: .4 },
28
+ output: { normal: 2 }
29
+ },
30
+ supports: {
31
+ input: [
32
+ "text",
33
+ "image",
34
+ "document"
35
+ ],
36
+ output: ["text"],
37
+ endpoints: ["chat"],
38
+ features: [
39
+ "streaming",
40
+ "tools",
41
+ "json_object",
42
+ "json_schema",
43
+ "vision"
44
+ ]
45
+ }
46
+ };
47
+ var MISTRAL_SMALL_LATEST = {
48
+ name: "mistral-small-latest",
49
+ context_window: 131072,
50
+ max_completion_tokens: 8192,
51
+ pricing: {
52
+ input: { normal: .1 },
53
+ output: { normal: .3 }
54
+ },
55
+ supports: {
56
+ input: [
57
+ "text",
58
+ "image",
59
+ "document"
60
+ ],
61
+ output: ["text"],
62
+ endpoints: ["chat"],
63
+ features: [
64
+ "streaming",
65
+ "tools",
66
+ "json_object",
67
+ "json_schema",
68
+ "vision"
69
+ ]
70
+ }
71
+ };
72
+ var MINISTRAL_8B_LATEST = {
73
+ name: "ministral-8b-latest",
74
+ context_window: 131072,
75
+ max_completion_tokens: 8192,
76
+ pricing: {
77
+ input: { normal: .1 },
78
+ output: { normal: .1 }
79
+ },
80
+ supports: {
81
+ input: ["text"],
82
+ output: ["text"],
83
+ endpoints: ["chat"],
84
+ features: [
85
+ "streaming",
86
+ "tools",
87
+ "json_object",
88
+ "json_schema"
89
+ ]
90
+ }
91
+ };
92
+ var MINISTRAL_3B_LATEST = {
93
+ name: "ministral-3b-latest",
94
+ context_window: 131072,
95
+ max_completion_tokens: 8192,
96
+ pricing: {
97
+ input: { normal: .04 },
98
+ output: { normal: .04 }
99
+ },
100
+ supports: {
101
+ input: ["text"],
102
+ output: ["text"],
103
+ endpoints: ["chat"],
104
+ features: [
105
+ "streaming",
106
+ "tools",
107
+ "json_object",
108
+ "json_schema"
109
+ ]
110
+ }
111
+ };
112
+ var CODESTRAL_LATEST = {
113
+ name: "codestral-latest",
114
+ context_window: 256e3,
115
+ max_completion_tokens: 8192,
116
+ pricing: {
117
+ input: { normal: .3 },
118
+ output: { normal: .9 }
119
+ },
120
+ supports: {
121
+ input: ["text"],
122
+ output: ["text"],
123
+ endpoints: ["chat"],
124
+ features: [
125
+ "streaming",
126
+ "tools",
127
+ "json_object",
128
+ "json_schema",
129
+ "code"
130
+ ]
131
+ }
132
+ };
133
+ var PIXTRAL_LARGE_LATEST = {
134
+ name: "pixtral-large-latest",
135
+ context_window: 131072,
136
+ max_completion_tokens: 8192,
137
+ pricing: {
138
+ input: { normal: 2 },
139
+ output: { normal: 6 }
140
+ },
141
+ supports: {
142
+ input: [
143
+ "text",
144
+ "image",
145
+ "document"
146
+ ],
147
+ output: ["text"],
148
+ endpoints: ["chat"],
149
+ features: [
150
+ "streaming",
151
+ "tools",
152
+ "json_object",
153
+ "json_schema",
154
+ "vision"
155
+ ]
156
+ }
157
+ };
158
+ var PIXTRAL_12B_2409 = {
159
+ name: "pixtral-12b-2409",
160
+ context_window: 131072,
161
+ max_completion_tokens: 8192,
162
+ pricing: {
163
+ input: { normal: .15 },
164
+ output: { normal: .15 }
165
+ },
166
+ supports: {
167
+ input: [
168
+ "text",
169
+ "image",
170
+ "document"
171
+ ],
172
+ output: ["text"],
173
+ endpoints: ["chat"],
174
+ features: [
175
+ "streaming",
176
+ "tools",
177
+ "json_object",
178
+ "vision"
179
+ ]
180
+ }
181
+ };
182
+ var MAGISTRAL_MEDIUM_LATEST = {
183
+ name: "magistral-medium-latest",
184
+ context_window: 4e4,
185
+ max_completion_tokens: 4e4,
186
+ pricing: {
187
+ input: { normal: 2 },
188
+ output: { normal: 5 }
189
+ },
190
+ supports: {
191
+ input: ["text"],
192
+ output: ["text"],
193
+ endpoints: ["chat"],
194
+ features: [
195
+ "streaming",
196
+ "tools",
197
+ "reasoning",
198
+ "json_object",
199
+ "json_schema"
200
+ ]
201
+ }
202
+ };
203
+ var MAGISTRAL_SMALL_LATEST = {
204
+ name: "magistral-small-latest",
205
+ context_window: 4e4,
206
+ max_completion_tokens: 4e4,
207
+ pricing: {
208
+ input: { normal: .5 },
209
+ output: { normal: 1.5 }
210
+ },
211
+ supports: {
212
+ input: ["text"],
213
+ output: ["text"],
214
+ endpoints: ["chat"],
215
+ features: [
216
+ "streaming",
217
+ "tools",
218
+ "reasoning",
219
+ "json_object",
220
+ "json_schema"
221
+ ]
222
+ }
223
+ };
224
+ var OPEN_MISTRAL_NEMO = {
225
+ name: "open-mistral-nemo",
226
+ context_window: 131072,
227
+ max_completion_tokens: 8192,
228
+ pricing: {
229
+ input: { normal: .15 },
230
+ output: { normal: .15 }
231
+ },
232
+ supports: {
233
+ input: ["text"],
234
+ output: ["text"],
235
+ endpoints: ["chat"],
236
+ features: [
237
+ "streaming",
238
+ "tools",
239
+ "json_object"
240
+ ]
241
+ }
242
+ };
243
+ var MISTRAL_MEDIUM_3 = {
244
+ name: "mistral-medium-3",
245
+ context_window: 131072,
246
+ max_completion_tokens: 8192,
247
+ pricing: {
248
+ input: { normal: .4 },
249
+ output: { normal: 2 }
250
+ },
251
+ supports: {
252
+ input: [
253
+ "text",
254
+ "image",
255
+ "document"
256
+ ],
257
+ output: ["text"],
258
+ endpoints: ["chat"],
259
+ features: [
260
+ "streaming",
261
+ "tools",
262
+ "json_object",
263
+ "json_schema",
264
+ "vision"
265
+ ]
266
+ }
267
+ };
268
+ var MISTRAL_SMALL_2503 = {
269
+ name: "mistral-small-2503",
270
+ context_window: 131072,
271
+ max_completion_tokens: 8192,
272
+ pricing: {
273
+ input: { normal: .1 },
274
+ output: { normal: .3 }
275
+ },
276
+ supports: {
277
+ input: [
278
+ "text",
279
+ "image",
280
+ "document"
281
+ ],
282
+ output: ["text"],
283
+ endpoints: ["chat"],
284
+ features: [
285
+ "streaming",
286
+ "tools",
287
+ "json_object",
288
+ "json_schema",
289
+ "vision"
290
+ ]
291
+ }
292
+ };
293
+ var CODESTRAL_2 = {
294
+ name: "codestral-2",
295
+ context_window: 131072,
296
+ max_completion_tokens: 8192,
297
+ pricing: {
298
+ input: { normal: .3 },
299
+ output: { normal: .9 }
300
+ },
301
+ supports: {
302
+ input: ["text"],
303
+ output: ["text"],
304
+ endpoints: ["chat"],
305
+ features: [
306
+ "streaming",
307
+ "tools",
308
+ "json_object",
309
+ "json_schema",
310
+ "code"
311
+ ]
312
+ }
313
+ };
1
314
  /**
2
315
  * All supported Mistral chat model identifiers.
3
316
  */
4
317
  var MISTRAL_CHAT_MODELS = [
5
- {
6
- name: "mistral-large-latest",
7
- context_window: 131072,
8
- max_completion_tokens: 8192,
9
- pricing: {
10
- input: { normal: .5 },
11
- output: { normal: 1.5 }
12
- },
13
- supports: {
14
- input: ["text"],
15
- output: ["text"],
16
- endpoints: ["chat"],
17
- features: [
18
- "streaming",
19
- "tools",
20
- "json_object",
21
- "json_schema"
22
- ]
23
- }
24
- }.name,
25
- {
26
- name: "mistral-medium-latest",
27
- context_window: 131072,
28
- max_completion_tokens: 8192,
29
- pricing: {
30
- input: { normal: .4 },
31
- output: { normal: 2 }
32
- },
33
- supports: {
34
- input: [
35
- "text",
36
- "image",
37
- "document"
38
- ],
39
- output: ["text"],
40
- endpoints: ["chat"],
41
- features: [
42
- "streaming",
43
- "tools",
44
- "json_object",
45
- "json_schema",
46
- "vision"
47
- ]
48
- }
49
- }.name,
50
- {
51
- name: "mistral-small-latest",
52
- context_window: 131072,
53
- max_completion_tokens: 8192,
54
- pricing: {
55
- input: { normal: .1 },
56
- output: { normal: .3 }
57
- },
58
- supports: {
59
- input: [
60
- "text",
61
- "image",
62
- "document"
63
- ],
64
- output: ["text"],
65
- endpoints: ["chat"],
66
- features: [
67
- "streaming",
68
- "tools",
69
- "json_object",
70
- "json_schema",
71
- "vision"
72
- ]
73
- }
74
- }.name,
75
- {
76
- name: "ministral-8b-latest",
77
- context_window: 131072,
78
- max_completion_tokens: 8192,
79
- pricing: {
80
- input: { normal: .1 },
81
- output: { normal: .1 }
82
- },
83
- supports: {
84
- input: ["text"],
85
- output: ["text"],
86
- endpoints: ["chat"],
87
- features: [
88
- "streaming",
89
- "tools",
90
- "json_object",
91
- "json_schema"
92
- ]
93
- }
94
- }.name,
95
- {
96
- name: "ministral-3b-latest",
97
- context_window: 131072,
98
- max_completion_tokens: 8192,
99
- pricing: {
100
- input: { normal: .04 },
101
- output: { normal: .04 }
102
- },
103
- supports: {
104
- input: ["text"],
105
- output: ["text"],
106
- endpoints: ["chat"],
107
- features: [
108
- "streaming",
109
- "tools",
110
- "json_object",
111
- "json_schema"
112
- ]
113
- }
114
- }.name,
115
- {
116
- name: "codestral-latest",
117
- context_window: 256e3,
118
- max_completion_tokens: 8192,
119
- pricing: {
120
- input: { normal: .3 },
121
- output: { normal: .9 }
122
- },
123
- supports: {
124
- input: ["text"],
125
- output: ["text"],
126
- endpoints: ["chat"],
127
- features: [
128
- "streaming",
129
- "tools",
130
- "json_object",
131
- "json_schema",
132
- "code"
133
- ]
134
- }
135
- }.name,
136
- {
137
- name: "pixtral-large-latest",
138
- context_window: 131072,
139
- max_completion_tokens: 8192,
140
- pricing: {
141
- input: { normal: 2 },
142
- output: { normal: 6 }
143
- },
144
- supports: {
145
- input: [
146
- "text",
147
- "image",
148
- "document"
149
- ],
150
- output: ["text"],
151
- endpoints: ["chat"],
152
- features: [
153
- "streaming",
154
- "tools",
155
- "json_object",
156
- "json_schema",
157
- "vision"
158
- ]
159
- }
160
- }.name,
161
- {
162
- name: "pixtral-12b-2409",
163
- context_window: 131072,
164
- max_completion_tokens: 8192,
165
- pricing: {
166
- input: { normal: .15 },
167
- output: { normal: .15 }
168
- },
169
- supports: {
170
- input: [
171
- "text",
172
- "image",
173
- "document"
174
- ],
175
- output: ["text"],
176
- endpoints: ["chat"],
177
- features: [
178
- "streaming",
179
- "tools",
180
- "json_object",
181
- "vision"
182
- ]
183
- }
184
- }.name,
185
- {
186
- name: "magistral-medium-latest",
187
- context_window: 4e4,
188
- max_completion_tokens: 4e4,
189
- pricing: {
190
- input: { normal: 2 },
191
- output: { normal: 5 }
192
- },
193
- supports: {
194
- input: ["text"],
195
- output: ["text"],
196
- endpoints: ["chat"],
197
- features: [
198
- "streaming",
199
- "tools",
200
- "reasoning",
201
- "json_object",
202
- "json_schema"
203
- ]
204
- }
205
- }.name,
206
- {
207
- name: "magistral-small-latest",
208
- context_window: 4e4,
209
- max_completion_tokens: 4e4,
210
- pricing: {
211
- input: { normal: .5 },
212
- output: { normal: 1.5 }
213
- },
214
- supports: {
215
- input: ["text"],
216
- output: ["text"],
217
- endpoints: ["chat"],
218
- features: [
219
- "streaming",
220
- "tools",
221
- "reasoning",
222
- "json_object",
223
- "json_schema"
224
- ]
225
- }
226
- }.name,
227
- {
228
- name: "open-mistral-nemo",
229
- context_window: 131072,
230
- max_completion_tokens: 8192,
231
- pricing: {
232
- input: { normal: .15 },
233
- output: { normal: .15 }
234
- },
235
- supports: {
236
- input: ["text"],
237
- output: ["text"],
238
- endpoints: ["chat"],
239
- features: [
240
- "streaming",
241
- "tools",
242
- "json_object"
243
- ]
244
- }
245
- }.name
318
+ MISTRAL_LARGE_LATEST.name,
319
+ MISTRAL_MEDIUM_LATEST.name,
320
+ MISTRAL_SMALL_LATEST.name,
321
+ MINISTRAL_8B_LATEST.name,
322
+ MINISTRAL_3B_LATEST.name,
323
+ CODESTRAL_LATEST.name,
324
+ PIXTRAL_LARGE_LATEST.name,
325
+ PIXTRAL_12B_2409.name,
326
+ MAGISTRAL_MEDIUM_LATEST.name,
327
+ MAGISTRAL_SMALL_LATEST.name,
328
+ OPEN_MISTRAL_NEMO.name
329
+ ];
330
+ /**
331
+ * Mistral chat models on Vertex AI / Gemini Enterprise Agent Platform.
332
+ * This list is the Google partner catalog, not the Mistral API catalog.
333
+ * OCR (`mistral-ocr-2505`) is not a chat model.
334
+ */
335
+ var MISTRAL_VERTEX_CHAT_MODELS = [
336
+ MISTRAL_MEDIUM_3.name,
337
+ MISTRAL_SMALL_2503.name,
338
+ CODESTRAL_2.name
246
339
  ];
247
340
  /**
248
341
  * Embedding models (based on endpoints: "embeddings")
249
342
  */
250
343
  var MISTRAL_EMBEDDING_MODELS = ["mistral-embed", "codestral-embed"];
251
344
  //#endregion
252
- export { MISTRAL_CHAT_MODELS, MISTRAL_EMBEDDING_MODELS };
345
+ export { MISTRAL_CHAT_MODELS, MISTRAL_EMBEDDING_MODELS, MISTRAL_VERTEX_CHAT_MODELS };
253
346
 
254
347
  //# sourceMappingURL=model-meta.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"model-meta.js","names":[],"sources":["../../src/model-meta.ts"],"sourcesContent":["import type { MistralTextProviderOptions } from './text/text-provider-options'\nimport type {\n CodestralEmbedProviderOptions,\n MistralEmbedProviderOptions,\n} from './embedding/embedding-provider-options'\n\n/** Provider options for vision-capable Mistral models (pixtral-*). */\nexport type MistralVisionProviderOptions = MistralTextProviderOptions\n\n/** Provider options for reasoning-capable Mistral models (magistral-*). */\nexport type MistralReasoningProviderOptions = MistralTextProviderOptions\n\n/**\n * Internal metadata structure describing a Mistral model's capabilities\n * and approximate pricing (USD per million tokens).\n */\ninterface ModelMeta<TProviderOptions = unknown> {\n name: string\n context_window?: number\n max_completion_tokens?: number\n pricing: {\n input?: { normal: number; cached?: number }\n output?: { normal: number }\n }\n supports: {\n input: Array<'text' | 'image' | 'audio' | 'document'>\n output: Array<'text'>\n endpoints: Array<'chat' | 'embeddings'>\n\n features: Array<\n | 'streaming'\n | 'tools'\n | 'json_object'\n | 'json_schema'\n | 'reasoning'\n | 'vision'\n | 'code'\n >\n }\n providerOptions?: TProviderOptions\n}\n\nconst MISTRAL_LARGE_LATEST = {\n name: 'mistral-large-latest',\n context_window: 131_072,\n max_completion_tokens: 8_192,\n pricing: {\n input: { normal: 0.5 },\n output: { normal: 1.5 },\n },\n supports: {\n input: ['text'],\n output: ['text'],\n endpoints: ['chat'],\n features: ['streaming', 'tools', 'json_object', 'json_schema'],\n },\n} as const satisfies ModelMeta<MistralTextProviderOptions>\n\nconst MISTRAL_MEDIUM_LATEST = {\n name: 'mistral-medium-latest',\n context_window: 131_072,\n max_completion_tokens: 8_192,\n pricing: {\n input: { normal: 0.4 },\n output: { normal: 2 },\n },\n supports: {\n input: ['text', 'image', 'document'],\n output: ['text'],\n endpoints: ['chat'],\n features: ['streaming', 'tools', 'json_object', 'json_schema', 'vision'],\n },\n} as const satisfies ModelMeta<MistralTextProviderOptions>\n\nconst MISTRAL_SMALL_LATEST = {\n name: 'mistral-small-latest',\n context_window: 131_072,\n max_completion_tokens: 8_192,\n pricing: {\n input: { normal: 0.1 },\n output: { normal: 0.3 },\n },\n supports: {\n input: ['text', 'image', 'document'],\n output: ['text'],\n endpoints: ['chat'],\n features: ['streaming', 'tools', 'json_object', 'json_schema', 'vision'],\n },\n} as const satisfies ModelMeta<MistralTextProviderOptions>\n\nconst MINISTRAL_8B_LATEST = {\n name: 'ministral-8b-latest',\n context_window: 131_072,\n max_completion_tokens: 8_192,\n pricing: {\n input: { normal: 0.1 },\n output: { normal: 0.1 },\n },\n supports: {\n input: ['text'],\n output: ['text'],\n endpoints: ['chat'],\n features: ['streaming', 'tools', 'json_object', 'json_schema'],\n },\n} as const satisfies ModelMeta<MistralTextProviderOptions>\n\nconst MINISTRAL_3B_LATEST = {\n name: 'ministral-3b-latest',\n context_window: 131_072,\n max_completion_tokens: 8_192,\n pricing: {\n input: { normal: 0.04 },\n output: { normal: 0.04 },\n },\n supports: {\n input: ['text'],\n output: ['text'],\n endpoints: ['chat'],\n features: ['streaming', 'tools', 'json_object', 'json_schema'],\n },\n} as const satisfies ModelMeta<MistralTextProviderOptions>\n\nconst CODESTRAL_LATEST = {\n name: 'codestral-latest',\n context_window: 256_000,\n max_completion_tokens: 8_192,\n pricing: {\n input: { normal: 0.3 },\n output: { normal: 0.9 },\n },\n supports: {\n input: ['text'],\n output: ['text'],\n endpoints: ['chat'],\n features: ['streaming', 'tools', 'json_object', 'json_schema', 'code'],\n },\n} as const satisfies ModelMeta<MistralTextProviderOptions>\n\nconst PIXTRAL_LARGE_LATEST = {\n name: 'pixtral-large-latest',\n context_window: 131_072,\n max_completion_tokens: 8_192,\n pricing: {\n input: { normal: 2 },\n output: { normal: 6 },\n },\n supports: {\n input: ['text', 'image', 'document'],\n output: ['text'],\n endpoints: ['chat'],\n features: ['streaming', 'tools', 'json_object', 'json_schema', 'vision'],\n },\n} as const satisfies ModelMeta<MistralTextProviderOptions>\n\nconst PIXTRAL_12B_2409 = {\n name: 'pixtral-12b-2409',\n context_window: 131_072,\n max_completion_tokens: 8_192,\n pricing: {\n input: { normal: 0.15 },\n output: { normal: 0.15 },\n },\n supports: {\n input: ['text', 'image', 'document'],\n output: ['text'],\n endpoints: ['chat'],\n features: ['streaming', 'tools', 'json_object', 'vision'],\n },\n} as const satisfies ModelMeta<MistralTextProviderOptions>\n\nconst MAGISTRAL_MEDIUM_LATEST = {\n name: 'magistral-medium-latest',\n context_window: 40_000,\n max_completion_tokens: 40_000,\n pricing: {\n input: { normal: 2 },\n output: { normal: 5 },\n },\n supports: {\n input: ['text'],\n output: ['text'],\n endpoints: ['chat'],\n features: ['streaming', 'tools', 'reasoning', 'json_object', 'json_schema'],\n },\n} as const satisfies ModelMeta<MistralTextProviderOptions>\n\nconst MAGISTRAL_SMALL_LATEST = {\n name: 'magistral-small-latest',\n context_window: 40_000,\n max_completion_tokens: 40_000,\n pricing: {\n input: { normal: 0.5 },\n output: { normal: 1.5 },\n },\n supports: {\n input: ['text'],\n output: ['text'],\n endpoints: ['chat'],\n features: ['streaming', 'tools', 'reasoning', 'json_object', 'json_schema'],\n },\n} as const satisfies ModelMeta<MistralTextProviderOptions>\n\nconst OPEN_MISTRAL_NEMO = {\n name: 'open-mistral-nemo',\n context_window: 131_072,\n max_completion_tokens: 8_192,\n pricing: {\n input: { normal: 0.15 },\n output: { normal: 0.15 },\n },\n supports: {\n input: ['text'],\n output: ['text'],\n endpoints: ['chat'],\n features: ['streaming', 'tools', 'json_object'],\n },\n} as const satisfies ModelMeta<MistralTextProviderOptions>\n\n/**\n * All supported Mistral chat model identifiers.\n */\nexport const MISTRAL_CHAT_MODELS = [\n MISTRAL_LARGE_LATEST.name,\n MISTRAL_MEDIUM_LATEST.name,\n MISTRAL_SMALL_LATEST.name,\n MINISTRAL_8B_LATEST.name,\n MINISTRAL_3B_LATEST.name,\n CODESTRAL_LATEST.name,\n PIXTRAL_LARGE_LATEST.name,\n PIXTRAL_12B_2409.name,\n MAGISTRAL_MEDIUM_LATEST.name,\n MAGISTRAL_SMALL_LATEST.name,\n OPEN_MISTRAL_NEMO.name,\n] as const\n\n/**\n * Union type of all supported Mistral chat model names.\n */\nexport type MistralChatModels = (typeof MISTRAL_CHAT_MODELS)[number]\n\n/**\n * Type-only map from Mistral chat model name to its supported input modalities.\n */\nexport type MistralModelInputModalitiesByName = {\n [MISTRAL_LARGE_LATEST.name]: typeof MISTRAL_LARGE_LATEST.supports.input\n [MISTRAL_MEDIUM_LATEST.name]: typeof MISTRAL_MEDIUM_LATEST.supports.input\n [MISTRAL_SMALL_LATEST.name]: typeof MISTRAL_SMALL_LATEST.supports.input\n [MINISTRAL_8B_LATEST.name]: typeof MINISTRAL_8B_LATEST.supports.input\n [MINISTRAL_3B_LATEST.name]: typeof MINISTRAL_3B_LATEST.supports.input\n [CODESTRAL_LATEST.name]: typeof CODESTRAL_LATEST.supports.input\n [PIXTRAL_LARGE_LATEST.name]: typeof PIXTRAL_LARGE_LATEST.supports.input\n [PIXTRAL_12B_2409.name]: typeof PIXTRAL_12B_2409.supports.input\n [MAGISTRAL_MEDIUM_LATEST.name]: typeof MAGISTRAL_MEDIUM_LATEST.supports.input\n [MAGISTRAL_SMALL_LATEST.name]: typeof MAGISTRAL_SMALL_LATEST.supports.input\n [OPEN_MISTRAL_NEMO.name]: typeof OPEN_MISTRAL_NEMO.supports.input\n}\n\n/**\n * Type-only map from Mistral chat model name to its provider options type.\n */\nexport type MistralChatModelProviderOptionsByName = {\n [MISTRAL_LARGE_LATEST.name]: MistralTextProviderOptions\n [MISTRAL_MEDIUM_LATEST.name]: MistralVisionProviderOptions\n [MISTRAL_SMALL_LATEST.name]: MistralVisionProviderOptions\n [MINISTRAL_8B_LATEST.name]: MistralTextProviderOptions\n [MINISTRAL_3B_LATEST.name]: MistralTextProviderOptions\n [CODESTRAL_LATEST.name]: MistralTextProviderOptions\n [PIXTRAL_LARGE_LATEST.name]: MistralVisionProviderOptions\n [PIXTRAL_12B_2409.name]: MistralVisionProviderOptions\n [MAGISTRAL_MEDIUM_LATEST.name]: MistralReasoningProviderOptions\n [MAGISTRAL_SMALL_LATEST.name]: MistralReasoningProviderOptions\n [OPEN_MISTRAL_NEMO.name]: MistralTextProviderOptions\n}\n\n/**\n * Embedding models (based on endpoints: \"embeddings\")\n */\nexport const MISTRAL_EMBEDDING_MODELS = [\n 'mistral-embed',\n 'codestral-embed',\n] as const\n\n/**\n * Union type of all supported Mistral embedding model names.\n */\nexport type MistralEmbeddingModel = (typeof MISTRAL_EMBEDDING_MODELS)[number]\n\n/**\n * Type-only map from embedding model name to its provider options type.\n *\n * `mistral-embed` accepts no provider options (fixed 1024-dim output);\n * `codestral-embed` additionally supports `outputDtype`.\n */\nexport type MistralEmbeddingModelProviderOptionsByName = {\n 'mistral-embed': MistralEmbedProviderOptions\n 'codestral-embed': CodestralEmbedProviderOptions\n}\n\n/**\n * Per-model input modalities for embedding models. Mistral embedding models\n * are text-only, so image inputs fail at compile time.\n */\nexport type MistralEmbeddingModelInputModalitiesByName = {\n 'mistral-embed': readonly ['text']\n 'codestral-embed': readonly ['text']\n}\n\n/**\n * Resolves the provider options type for a specific Mistral model.\n */\nexport type ResolveProviderOptions<TModel extends string> =\n TModel extends keyof MistralChatModelProviderOptionsByName\n ? MistralChatModelProviderOptionsByName[TModel]\n : MistralTextProviderOptions\n\n/**\n * Resolve input modalities for a specific model.\n */\nexport type ResolveInputModalities<TModel extends string> =\n TModel extends keyof MistralModelInputModalitiesByName\n ? MistralModelInputModalitiesByName[TModel]\n : readonly ['text']\n"],"mappings":";;;AA6NA,IAAa,sBAAsB;CACjC;EAnLA,MAAM;EACN,gBAAgB;EAChB,uBAAuB;EACvB,SAAS;GACP,OAAO,EAAE,QAAQ,GAAI;GACrB,QAAQ,EAAE,QAAQ,IAAI;EACxB;EACA,UAAU;GACR,OAAO,CAAC,MAAM;GACd,QAAQ,CAAC,MAAM;GACf,WAAW,CAAC,MAAM;GAClB,UAAU;IAAC;IAAa;IAAS;IAAe;GAAa;EAC/D;CAuKA,EAAqB;CACrB;EApKA,MAAM;EACN,gBAAgB;EAChB,uBAAuB;EACvB,SAAS;GACP,OAAO,EAAE,QAAQ,GAAI;GACrB,QAAQ,EAAE,QAAQ,EAAE;EACtB;EACA,UAAU;GACR,OAAO;IAAC;IAAQ;IAAS;GAAU;GACnC,QAAQ,CAAC,MAAM;GACf,WAAW,CAAC,MAAM;GAClB,UAAU;IAAC;IAAa;IAAS;IAAe;IAAe;GAAQ;EACzE;CAwJA,EAAsB;CACtB;EArJA,MAAM;EACN,gBAAgB;EAChB,uBAAuB;EACvB,SAAS;GACP,OAAO,EAAE,QAAQ,GAAI;GACrB,QAAQ,EAAE,QAAQ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file":"model-meta.js","names":[],"sources":["../../src/model-meta.ts"],"sourcesContent":["import type { MistralTextProviderOptions } from './text/text-provider-options'\nimport type {\n CodestralEmbedProviderOptions,\n MistralEmbedProviderOptions,\n} from './embedding/embedding-provider-options'\n\n/** Provider options for vision-capable Mistral models (pixtral-*). */\nexport type MistralVisionProviderOptions = MistralTextProviderOptions\n\n/** Provider options for reasoning-capable Mistral models (magistral-*). */\nexport type MistralReasoningProviderOptions = MistralTextProviderOptions\n\n/**\n * Internal metadata structure describing a Mistral model's capabilities\n * and approximate pricing (USD per million tokens).\n */\ninterface ModelMeta<TProviderOptions = unknown> {\n name: string\n context_window?: number\n max_completion_tokens?: number\n pricing: {\n input?: { normal: number; cached?: number }\n output?: { normal: number }\n }\n supports: {\n input: Array<'text' | 'image' | 'audio' | 'document'>\n output: Array<'text'>\n endpoints: Array<'chat' | 'embeddings'>\n\n features: Array<\n | 'streaming'\n | 'tools'\n | 'json_object'\n | 'json_schema'\n | 'reasoning'\n | 'vision'\n | 'code'\n >\n }\n providerOptions?: TProviderOptions\n}\n\nconst MISTRAL_LARGE_LATEST = {\n name: 'mistral-large-latest',\n context_window: 131_072,\n max_completion_tokens: 8_192,\n pricing: {\n input: { normal: 0.5 },\n output: { normal: 1.5 },\n },\n supports: {\n input: ['text'],\n output: ['text'],\n endpoints: ['chat'],\n features: ['streaming', 'tools', 'json_object', 'json_schema'],\n },\n} as const satisfies ModelMeta<MistralTextProviderOptions>\n\nconst MISTRAL_MEDIUM_LATEST = {\n name: 'mistral-medium-latest',\n context_window: 131_072,\n max_completion_tokens: 8_192,\n pricing: {\n input: { normal: 0.4 },\n output: { normal: 2 },\n },\n supports: {\n input: ['text', 'image', 'document'],\n output: ['text'],\n endpoints: ['chat'],\n features: ['streaming', 'tools', 'json_object', 'json_schema', 'vision'],\n },\n} as const satisfies ModelMeta<MistralTextProviderOptions>\n\nconst MISTRAL_SMALL_LATEST = {\n name: 'mistral-small-latest',\n context_window: 131_072,\n max_completion_tokens: 8_192,\n pricing: {\n input: { normal: 0.1 },\n output: { normal: 0.3 },\n },\n supports: {\n input: ['text', 'image', 'document'],\n output: ['text'],\n endpoints: ['chat'],\n features: ['streaming', 'tools', 'json_object', 'json_schema', 'vision'],\n },\n} as const satisfies ModelMeta<MistralTextProviderOptions>\n\nconst MINISTRAL_8B_LATEST = {\n name: 'ministral-8b-latest',\n context_window: 131_072,\n max_completion_tokens: 8_192,\n pricing: {\n input: { normal: 0.1 },\n output: { normal: 0.1 },\n },\n supports: {\n input: ['text'],\n output: ['text'],\n endpoints: ['chat'],\n features: ['streaming', 'tools', 'json_object', 'json_schema'],\n },\n} as const satisfies ModelMeta<MistralTextProviderOptions>\n\nconst MINISTRAL_3B_LATEST = {\n name: 'ministral-3b-latest',\n context_window: 131_072,\n max_completion_tokens: 8_192,\n pricing: {\n input: { normal: 0.04 },\n output: { normal: 0.04 },\n },\n supports: {\n input: ['text'],\n output: ['text'],\n endpoints: ['chat'],\n features: ['streaming', 'tools', 'json_object', 'json_schema'],\n },\n} as const satisfies ModelMeta<MistralTextProviderOptions>\n\nconst CODESTRAL_LATEST = {\n name: 'codestral-latest',\n context_window: 256_000,\n max_completion_tokens: 8_192,\n pricing: {\n input: { normal: 0.3 },\n output: { normal: 0.9 },\n },\n supports: {\n input: ['text'],\n output: ['text'],\n endpoints: ['chat'],\n features: ['streaming', 'tools', 'json_object', 'json_schema', 'code'],\n },\n} as const satisfies ModelMeta<MistralTextProviderOptions>\n\nconst PIXTRAL_LARGE_LATEST = {\n name: 'pixtral-large-latest',\n context_window: 131_072,\n max_completion_tokens: 8_192,\n pricing: {\n input: { normal: 2 },\n output: { normal: 6 },\n },\n supports: {\n input: ['text', 'image', 'document'],\n output: ['text'],\n endpoints: ['chat'],\n features: ['streaming', 'tools', 'json_object', 'json_schema', 'vision'],\n },\n} as const satisfies ModelMeta<MistralTextProviderOptions>\n\nconst PIXTRAL_12B_2409 = {\n name: 'pixtral-12b-2409',\n context_window: 131_072,\n max_completion_tokens: 8_192,\n pricing: {\n input: { normal: 0.15 },\n output: { normal: 0.15 },\n },\n supports: {\n input: ['text', 'image', 'document'],\n output: ['text'],\n endpoints: ['chat'],\n features: ['streaming', 'tools', 'json_object', 'vision'],\n },\n} as const satisfies ModelMeta<MistralTextProviderOptions>\n\nconst MAGISTRAL_MEDIUM_LATEST = {\n name: 'magistral-medium-latest',\n context_window: 40_000,\n max_completion_tokens: 40_000,\n pricing: {\n input: { normal: 2 },\n output: { normal: 5 },\n },\n supports: {\n input: ['text'],\n output: ['text'],\n endpoints: ['chat'],\n features: ['streaming', 'tools', 'reasoning', 'json_object', 'json_schema'],\n },\n} as const satisfies ModelMeta<MistralTextProviderOptions>\n\nconst MAGISTRAL_SMALL_LATEST = {\n name: 'magistral-small-latest',\n context_window: 40_000,\n max_completion_tokens: 40_000,\n pricing: {\n input: { normal: 0.5 },\n output: { normal: 1.5 },\n },\n supports: {\n input: ['text'],\n output: ['text'],\n endpoints: ['chat'],\n features: ['streaming', 'tools', 'reasoning', 'json_object', 'json_schema'],\n },\n} as const satisfies ModelMeta<MistralTextProviderOptions>\n\nconst OPEN_MISTRAL_NEMO = {\n name: 'open-mistral-nemo',\n context_window: 131_072,\n max_completion_tokens: 8_192,\n pricing: {\n input: { normal: 0.15 },\n output: { normal: 0.15 },\n },\n supports: {\n input: ['text'],\n output: ['text'],\n endpoints: ['chat'],\n features: ['streaming', 'tools', 'json_object'],\n },\n} as const satisfies ModelMeta<MistralTextProviderOptions>\n\n// Vertex Model Garden IDs. These are not the Mistral API catalog.\n// Source: https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/partner-models/mistral\nconst MISTRAL_MEDIUM_3 = {\n name: 'mistral-medium-3',\n context_window: 131_072,\n max_completion_tokens: 8_192,\n pricing: {\n input: { normal: 0.4 },\n output: { normal: 2 },\n },\n supports: {\n input: ['text', 'image', 'document'],\n output: ['text'],\n endpoints: ['chat'],\n features: ['streaming', 'tools', 'json_object', 'json_schema', 'vision'],\n },\n} as const satisfies ModelMeta<MistralTextProviderOptions>\n\nconst MISTRAL_SMALL_2503 = {\n name: 'mistral-small-2503',\n context_window: 131_072,\n max_completion_tokens: 8_192,\n pricing: {\n input: { normal: 0.1 },\n output: { normal: 0.3 },\n },\n supports: {\n input: ['text', 'image', 'document'],\n output: ['text'],\n endpoints: ['chat'],\n features: ['streaming', 'tools', 'json_object', 'json_schema', 'vision'],\n },\n} as const satisfies ModelMeta<MistralTextProviderOptions>\n\nconst CODESTRAL_2 = {\n name: 'codestral-2',\n context_window: 131_072,\n max_completion_tokens: 8_192,\n pricing: {\n input: { normal: 0.3 },\n output: { normal: 0.9 },\n },\n supports: {\n input: ['text'],\n output: ['text'],\n endpoints: ['chat'],\n features: ['streaming', 'tools', 'json_object', 'json_schema', 'code'],\n },\n} as const satisfies ModelMeta<MistralTextProviderOptions>\n\n/**\n * All supported Mistral chat model identifiers.\n */\nexport const MISTRAL_CHAT_MODELS = [\n MISTRAL_LARGE_LATEST.name,\n MISTRAL_MEDIUM_LATEST.name,\n MISTRAL_SMALL_LATEST.name,\n MINISTRAL_8B_LATEST.name,\n MINISTRAL_3B_LATEST.name,\n CODESTRAL_LATEST.name,\n PIXTRAL_LARGE_LATEST.name,\n PIXTRAL_12B_2409.name,\n MAGISTRAL_MEDIUM_LATEST.name,\n MAGISTRAL_SMALL_LATEST.name,\n OPEN_MISTRAL_NEMO.name,\n] as const\n\n/**\n * Union type of all supported Mistral chat model names.\n */\nexport type MistralChatModels = (typeof MISTRAL_CHAT_MODELS)[number]\n\n/**\n * Mistral chat models on Vertex AI / Gemini Enterprise Agent Platform.\n * This list is the Google partner catalog, not the Mistral API catalog.\n * OCR (`mistral-ocr-2505`) is not a chat model.\n */\nexport const MISTRAL_VERTEX_CHAT_MODELS = [\n MISTRAL_MEDIUM_3.name,\n MISTRAL_SMALL_2503.name,\n CODESTRAL_2.name,\n] as const\n\nexport type MistralVertexChatModel = (typeof MISTRAL_VERTEX_CHAT_MODELS)[number]\nexport type MistralTextAdapterModel = MistralChatModels | MistralVertexChatModel\n\n/**\n * Type-only map from Mistral chat model name to its supported input modalities.\n */\nexport type MistralModelInputModalitiesByName = {\n [MISTRAL_LARGE_LATEST.name]: typeof MISTRAL_LARGE_LATEST.supports.input\n [MISTRAL_MEDIUM_LATEST.name]: typeof MISTRAL_MEDIUM_LATEST.supports.input\n [MISTRAL_SMALL_LATEST.name]: typeof MISTRAL_SMALL_LATEST.supports.input\n [MINISTRAL_8B_LATEST.name]: typeof MINISTRAL_8B_LATEST.supports.input\n [MINISTRAL_3B_LATEST.name]: typeof MINISTRAL_3B_LATEST.supports.input\n [CODESTRAL_LATEST.name]: typeof CODESTRAL_LATEST.supports.input\n [PIXTRAL_LARGE_LATEST.name]: typeof PIXTRAL_LARGE_LATEST.supports.input\n [PIXTRAL_12B_2409.name]: typeof PIXTRAL_12B_2409.supports.input\n [MAGISTRAL_MEDIUM_LATEST.name]: typeof MAGISTRAL_MEDIUM_LATEST.supports.input\n [MAGISTRAL_SMALL_LATEST.name]: typeof MAGISTRAL_SMALL_LATEST.supports.input\n [OPEN_MISTRAL_NEMO.name]: typeof OPEN_MISTRAL_NEMO.supports.input\n [MISTRAL_MEDIUM_3.name]: typeof MISTRAL_MEDIUM_3.supports.input\n [MISTRAL_SMALL_2503.name]: typeof MISTRAL_SMALL_2503.supports.input\n [CODESTRAL_2.name]: typeof CODESTRAL_2.supports.input\n}\n\n/**\n * Type-only map from Mistral chat model name to its provider options type.\n */\nexport type MistralChatModelProviderOptionsByName = {\n [MISTRAL_LARGE_LATEST.name]: MistralTextProviderOptions\n [MISTRAL_MEDIUM_LATEST.name]: MistralVisionProviderOptions\n [MISTRAL_SMALL_LATEST.name]: MistralVisionProviderOptions\n [MINISTRAL_8B_LATEST.name]: MistralTextProviderOptions\n [MINISTRAL_3B_LATEST.name]: MistralTextProviderOptions\n [CODESTRAL_LATEST.name]: MistralTextProviderOptions\n [PIXTRAL_LARGE_LATEST.name]: MistralVisionProviderOptions\n [PIXTRAL_12B_2409.name]: MistralVisionProviderOptions\n [MAGISTRAL_MEDIUM_LATEST.name]: MistralReasoningProviderOptions\n [MAGISTRAL_SMALL_LATEST.name]: MistralReasoningProviderOptions\n [OPEN_MISTRAL_NEMO.name]: MistralTextProviderOptions\n [MISTRAL_MEDIUM_3.name]: MistralVisionProviderOptions\n [MISTRAL_SMALL_2503.name]: MistralVisionProviderOptions\n [CODESTRAL_2.name]: MistralTextProviderOptions\n}\n\n/**\n * Embedding models (based on endpoints: \"embeddings\")\n */\nexport const MISTRAL_EMBEDDING_MODELS = [\n 'mistral-embed',\n 'codestral-embed',\n] as const\n\n/**\n * Union type of all supported Mistral embedding model names.\n */\nexport type MistralEmbeddingModel = (typeof MISTRAL_EMBEDDING_MODELS)[number]\n\n/**\n * Type-only map from embedding model name to its provider options type.\n *\n * `mistral-embed` accepts no provider options (fixed 1024-dim output);\n * `codestral-embed` additionally supports `outputDtype`.\n */\nexport type MistralEmbeddingModelProviderOptionsByName = {\n 'mistral-embed': MistralEmbedProviderOptions\n 'codestral-embed': CodestralEmbedProviderOptions\n}\n\n/**\n * Per-model input modalities for embedding models. Mistral embedding models\n * are text-only, so image inputs fail at compile time.\n */\nexport type MistralEmbeddingModelInputModalitiesByName = {\n 'mistral-embed': readonly ['text']\n 'codestral-embed': readonly ['text']\n}\n\n/**\n * Resolves the provider options type for a specific Mistral model.\n */\nexport type ResolveProviderOptions<TModel extends string> =\n TModel extends keyof MistralChatModelProviderOptionsByName\n ? MistralChatModelProviderOptionsByName[TModel]\n : MistralTextProviderOptions\n\n/**\n * Resolve input modalities for a specific model.\n */\nexport type ResolveInputModalities<TModel extends string> =\n TModel extends keyof MistralModelInputModalitiesByName\n ? MistralModelInputModalitiesByName[TModel]\n : readonly ['text']\n"],"mappings":";AA0CA,IAAM,uBAAuB;CAC3B,MAAM;CACN,gBAAgB;CAChB,uBAAuB;CACvB,SAAS;EACP,OAAO,EAAE,QAAQ,GAAI;EACrB,QAAQ,EAAE,QAAQ,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AAQ,EAAE,QAAQ,GAAI;CACxB;CACA,UAAU;EACR,OAAO,CAAC,MAAM;EACd,QAAQ,CAAC,MAAM;EACf,WAAW,CAAC,MAAM;EAClB,UAAU;GAAC;GAAa;GAAS;GAAe;GAAe;EAAM;CACvE;AACF;;;;AAKA,IAAa,sBAAsB;CACjC,qBAAqB;CACrB,sBAAsB;CACtB,qBAAqB;CACrB,oBAAoB;CACpB,oBAAoB;CACpB,iBAAiB;CACjB,qBAAqB;CACrB,iBAAiB;CACjB,wBAAwB;CACxB,uBAAuB;CACvB,kBAAkB;AACpB;;;;;;AAYA,IAAa,6BAA6B;CACxC,iBAAiB;CACjB,mBAAmB;CACnB,YAAY;AACd;;;;AAgDA,IAAa,2BAA2B,CACtC,iBACA,iBACF"}
@@ -4,10 +4,9 @@ export type FunctionTool = ChatCompletionTool;
4
4
  /**
5
5
  * Converts a standard Tool to Mistral ChatCompletionTool format.
6
6
  *
7
- * Tool schemas are already converted to JSON Schema in the ai layer.
8
- * We apply Mistral-specific transformations for strict mode:
9
- * - All properties in required array
10
- * - Optional fields made nullable
11
- * - additionalProperties: false
7
+ * Tool schemas are already JSON Schema in the ai layer. When the schema can
8
+ * be inverted, rewrite it for strict mode (required, nullable optionals,
9
+ * `additionalProperties: false`) and set `strict: true`. Otherwise leave the
10
+ * schema intact and set `strict: false`.
12
11
  */
13
12
  export declare function convertFunctionToolToAdapterFormat(tool: Tool): FunctionTool;