@core-ai/mistral 0.22.0 → 0.23.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 +5 -2
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -695,7 +695,7 @@ function wrapMistralError(error) {
695
695
  const message = getErrorMessage(error);
696
696
  const statusCode = error instanceof MistralError ? error.statusCode : getHttpStatusCode(error, ["statusCode", "status"]);
697
697
  const body = parseErrorBody(error);
698
- const options = { statusCode, cause: error };
698
+ const options = { statusCode, code: body?.type, cause: error };
699
699
  const contextLength = getContextLengthDetails(body, message);
700
700
  if (contextLength) {
701
701
  return new ContextLengthExceededError(message, "mistral", {
@@ -851,7 +851,10 @@ function createMistralChatModel(client, modelId) {
851
851
  })
852
852
  )
853
853
  ),
854
- { signal: options.signal }
854
+ {
855
+ signal: options.signal,
856
+ mapError: wrapMistralError
857
+ }
855
858
  );
856
859
  }
857
860
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@core-ai/mistral",
3
- "version": "0.22.0",
3
+ "version": "0.23.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.22.0",
46
+ "@core-ai/core-ai": "^0.23.0",
47
47
  "@mistralai/mistralai": "^2.4.1"
48
48
  },
49
49
  "peerDependencies": {