@ai-sdk/anthropic 4.0.69 → 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.
@@ -2773,20 +2773,19 @@ async function convertToAnthropicPrompt({ prompt, sendReasoning, warnings, cache
2773
2773
  toolsetNames
2774
2774
  });
2775
2775
  if (toolsetName != null) {
2776
- const { action, ...memberInput } = toAnthropicToolInput(part.input);
2777
- if (typeof action !== "string") {
2778
- warnings.push({
2779
- type: "other",
2780
- message: `toolset tool call for tool ${part.toolName} is missing the action`
2781
- });
2782
- break;
2783
- }
2776
+ const rawInput = toAnthropicToolInput(part.input);
2777
+ const { action } = rawInput;
2778
+ const hasAction = typeof action === "string";
2779
+ if (!hasAction) warnings.push({
2780
+ type: "other",
2781
+ message: `toolset tool call for tool ${part.toolName} is missing the action`
2782
+ });
2784
2783
  anthropicContent.push({
2785
2784
  type: "tool_use",
2786
2785
  id: part.toolCallId,
2787
- name: action,
2786
+ name: hasAction ? action : toolsetName,
2788
2787
  toolset_name: toolsetName,
2789
- input: memberInput,
2788
+ input: rawInput,
2790
2789
  ...caller && { caller },
2791
2790
  cache_control: cacheControl
2792
2791
  });