@ai-sdk/anthropic 4.0.8 → 4.0.10

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.10
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [ac306ed]
8
+ - @ai-sdk/provider-utils@5.0.6
9
+
10
+ ## 4.0.9
11
+
12
+ ### Patch Changes
13
+
14
+ - 2e45d9c: fix(anthropic): wrap invalid tool input in object
15
+
3
16
  ## 4.0.8
4
17
 
5
18
  ### Patch Changes
package/dist/index.js CHANGED
@@ -2891,7 +2891,7 @@ async function convertToAnthropicPrompt({
2891
2891
  type: "tool_use",
2892
2892
  id: part.toolCallId,
2893
2893
  name: part.toolName,
2894
- input: part.input,
2894
+ input: toAnthropicToolInput(part.input),
2895
2895
  ...caller && { caller },
2896
2896
  cache_control: cacheControl
2897
2897
  });
@@ -3291,6 +3291,9 @@ function moveToolUseBlocksToEnd(content) {
3291
3291
  flushSegment();
3292
3292
  return result;
3293
3293
  }
3294
+ function toAnthropicToolInput(input) {
3295
+ return typeof input === "object" && input !== null && !Array.isArray(input) ? input : { rawInvalidInput: input };
3296
+ }
3294
3297
 
3295
3298
  // src/map-anthropic-stop-reason.ts
3296
3299
  function mapAnthropicStopReason({
@@ -6292,7 +6295,7 @@ var AnthropicSkills = class {
6292
6295
  };
6293
6296
 
6294
6297
  // src/version.ts
6295
- var VERSION = true ? "4.0.8" : "0.0.0-test";
6298
+ var VERSION = true ? "4.0.10" : "0.0.0-test";
6296
6299
 
6297
6300
  // src/anthropic-provider.ts
6298
6301
  var ANTHROPIC_API_URL = "https://api.anthropic.com";