@ai-sdk/anthropic 4.0.0-beta.0 → 4.0.0-beta.2

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,18 @@
1
1
  # @ai-sdk/anthropic
2
2
 
3
+ ## 4.0.0-beta.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 1fe058b: fix(anthropic): preserve the error code returned by model
8
+
9
+ ## 4.0.0-beta.1
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [531251e]
14
+ - @ai-sdk/provider-utils@5.0.0-beta.1
15
+
3
16
  ## 4.0.0-beta.0
4
17
 
5
18
  ### Major Changes
package/dist/index.js CHANGED
@@ -32,7 +32,7 @@ var import_provider4 = require("@ai-sdk/provider");
32
32
  var import_provider_utils26 = require("@ai-sdk/provider-utils");
33
33
 
34
34
  // src/version.ts
35
- var VERSION = true ? "4.0.0-beta.0" : "0.0.0-test";
35
+ var VERSION = true ? "4.0.0-beta.2" : "0.0.0-test";
36
36
 
37
37
  // src/anthropic-messages-language-model.ts
38
38
  var import_provider3 = require("@ai-sdk/provider");
@@ -2587,7 +2587,7 @@ async function convertToAnthropicMessagesPrompt({
2587
2587
  } catch (e) {
2588
2588
  const extractedErrorCode = (_r = output.value) == null ? void 0 : _r.errorCode;
2589
2589
  errorValue = {
2590
- errorCode: typeof extractedErrorCode === "string" ? extractedErrorCode : "unknown"
2590
+ errorCode: typeof extractedErrorCode === "string" ? extractedErrorCode : "unavailable"
2591
2591
  };
2592
2592
  }
2593
2593
  anthropicContent.push({
@@ -2595,7 +2595,7 @@ async function convertToAnthropicMessagesPrompt({
2595
2595
  tool_use_id: part.toolCallId,
2596
2596
  content: {
2597
2597
  type: "web_fetch_tool_result_error",
2598
- error_code: (_s = errorValue.errorCode) != null ? _s : "unknown"
2598
+ error_code: (_s = errorValue.errorCode) != null ? _s : "unavailable"
2599
2599
  },
2600
2600
  cache_control: cacheControl
2601
2601
  });