@ai-sdk/anthropic 4.0.70 → 4.0.71

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,11 @@
1
1
  # @ai-sdk/anthropic
2
2
 
3
+ ## 4.0.71
4
+
5
+ ### Patch Changes
6
+
7
+ - c35458e: fix(anthropic): preserve invalid toolset calls
8
+
3
9
  ## 4.0.70
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -2774,20 +2774,19 @@ async function convertToAnthropicPrompt({ prompt, sendReasoning, warnings, cache
2774
2774
  toolsetNames
2775
2775
  });
2776
2776
  if (toolsetName != null) {
2777
- const { action, ...memberInput } = toAnthropicToolInput(part.input);
2778
- if (typeof action !== "string") {
2779
- warnings.push({
2780
- type: "other",
2781
- message: `toolset tool call for tool ${part.toolName} is missing the action`
2782
- });
2783
- break;
2784
- }
2777
+ const rawInput = toAnthropicToolInput(part.input);
2778
+ const { action } = rawInput;
2779
+ const hasAction = typeof action === "string";
2780
+ if (!hasAction) warnings.push({
2781
+ type: "other",
2782
+ message: `toolset tool call for tool ${part.toolName} is missing the action`
2783
+ });
2785
2784
  anthropicContent.push({
2786
2785
  type: "tool_use",
2787
2786
  id: part.toolCallId,
2788
- name: action,
2787
+ name: hasAction ? action : toolsetName,
2789
2788
  toolset_name: toolsetName,
2790
- input: memberInput,
2789
+ input: rawInput,
2791
2790
  ...caller && { caller },
2792
2791
  cache_control: cacheControl
2793
2792
  });
@@ -6830,7 +6829,7 @@ var AnthropicSkills = class {
6830
6829
  };
6831
6830
  //#endregion
6832
6831
  //#region src/version.ts
6833
- const VERSION = "4.0.70";
6832
+ const VERSION = "4.0.71";
6834
6833
  //#endregion
6835
6834
  //#region src/anthropic-provider.ts
6836
6835
  const ANTHROPIC_API_URL = "https://api.anthropic.com";