@core-ai/mistral 0.24.0 → 0.26.0

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 (2) hide show
  1. package/dist/index.js +18 -2
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -17,6 +17,7 @@ import {
17
17
  safeParseJsonObject,
18
18
  ValidationError,
19
19
  validateInputModalities,
20
+ validateToolSchemaStrictness,
20
21
  zodSchemaToJsonSchema
21
22
  } from "@core-ai/core-ai";
22
23
 
@@ -58,7 +59,8 @@ import {
58
59
  MULTIMODAL_INPUT_MODALITIES,
59
60
  stripModelDateSuffix,
60
61
  TEXT_ONLY_MODALITIES,
61
- UNKNOWN_MODEL
62
+ UNKNOWN_MODEL,
63
+ UNSUPPORTED_TOOL_SCHEMA_STRICTNESS
62
64
  } from "@core-ai/core-ai";
63
65
  var MISTRAL_VERSION_SUFFIX_PATTERN = /-(?:latest|\d{4})$/;
64
66
  function createCapabilities(modalities) {
@@ -69,7 +71,13 @@ function createCapabilities(modalities) {
69
71
  restrictsSamplingParams: false,
70
72
  supportedToolChoices: ["auto", "none", "required", "tool"]
71
73
  },
72
- modalities
74
+ modalities,
75
+ tools: {
76
+ // Mistral's SDK exposes a `strict` field on functions, but the API
77
+ // does not document grammar-enforced adherence — keep unsupported
78
+ // until enforcement is verified (follow-up candidate).
79
+ strictSchemas: UNSUPPORTED_TOOL_SCHEMA_STRICTNESS
80
+ }
73
81
  };
74
82
  }
75
83
  var VISION_CAPABILITIES = createCapabilities(MULTIMODAL_INPUT_MODALITIES);
@@ -307,6 +315,14 @@ function createRequestBase(modelId, options, adapterOptions) {
307
315
  modelId,
308
316
  providerId
309
317
  });
318
+ if (options.tools) {
319
+ validateToolSchemaStrictness({
320
+ tools: options.tools,
321
+ capabilities,
322
+ providerId,
323
+ modelId
324
+ });
325
+ }
310
326
  return {
311
327
  model: modelId,
312
328
  messages: convertMessages(options.messages, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@core-ai/mistral",
3
- "version": "0.24.0",
3
+ "version": "0.26.0",
4
4
  "description": "Mistral provider package for @core-ai/core-ai",
5
5
  "license": "MIT",
6
6
  "author": "Omnifact (https://omnifact.ai)",
@@ -43,7 +43,7 @@
43
43
  "test:watch": "vitest"
44
44
  },
45
45
  "dependencies": {
46
- "@core-ai/core-ai": "^0.24.0",
46
+ "@core-ai/core-ai": "^0.26.0",
47
47
  "@mistralai/mistralai": "^2.4.1"
48
48
  },
49
49
  "peerDependencies": {