@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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/anthropic",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.71",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@ai-sdk/provider": "4.0.
|
|
39
|
-
"@ai-sdk/provider-utils": "5.0.
|
|
38
|
+
"@ai-sdk/provider": "4.0.21",
|
|
39
|
+
"@ai-sdk/provider-utils": "5.0.53"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@ai-sdk/test-server": "2.0.3",
|
|
@@ -983,24 +983,23 @@ export async function convertToAnthropicPrompt({
|
|
|
983
983
|
|
|
984
984
|
if (toolsetName != null) {
|
|
985
985
|
// toolset member call: the `action` is the member tool name
|
|
986
|
-
const
|
|
987
|
-
|
|
988
|
-
|
|
986
|
+
const rawInput = toAnthropicToolInput(part.input);
|
|
987
|
+
const { action } = rawInput;
|
|
988
|
+
const hasAction = typeof action === 'string';
|
|
989
989
|
|
|
990
|
-
if (
|
|
990
|
+
if (!hasAction) {
|
|
991
991
|
warnings.push({
|
|
992
992
|
type: 'other',
|
|
993
993
|
message: `toolset tool call for tool ${part.toolName} is missing the action`,
|
|
994
994
|
});
|
|
995
|
-
break;
|
|
996
995
|
}
|
|
997
996
|
|
|
998
997
|
anthropicContent.push({
|
|
999
998
|
type: 'tool_use',
|
|
1000
999
|
id: part.toolCallId,
|
|
1001
|
-
name: action,
|
|
1000
|
+
name: hasAction ? action : toolsetName,
|
|
1002
1001
|
toolset_name: toolsetName,
|
|
1003
|
-
input:
|
|
1002
|
+
input: rawInput,
|
|
1004
1003
|
...(caller && { caller }),
|
|
1005
1004
|
cache_control: cacheControl,
|
|
1006
1005
|
});
|