@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.
- package/CHANGELOG.md +15 -0
- package/dist/index.js +10 -11
- package/dist/index.js.map +1 -1
- package/dist/internal/index.js +9 -10
- package/dist/internal/index.js.map +1 -1
- package/package.json +3 -3
- package/src/convert-to-anthropic-prompt.ts +6 -7
package/dist/internal/index.js
CHANGED
|
@@ -2773,20 +2773,19 @@ async function convertToAnthropicPrompt({ prompt, sendReasoning, warnings, cache
|
|
|
2773
2773
|
toolsetNames
|
|
2774
2774
|
});
|
|
2775
2775
|
if (toolsetName != null) {
|
|
2776
|
-
const
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
}
|
|
2782
|
-
|
|
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:
|
|
2788
|
+
input: rawInput,
|
|
2790
2789
|
...caller && { caller },
|
|
2791
2790
|
cache_control: cacheControl
|
|
2792
2791
|
});
|