@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/anthropic",
3
- "version": "4.0.70",
3
+ "version": "4.0.71",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -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 { action, ...memberInput } = toAnthropicToolInput(
987
- part.input,
988
- );
986
+ const rawInput = toAnthropicToolInput(part.input);
987
+ const { action } = rawInput;
988
+ const hasAction = typeof action === 'string';
989
989
 
990
- if (typeof action !== 'string') {
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: memberInput,
1002
+ input: rawInput,
1004
1003
  ...(caller && { caller }),
1005
1004
  cache_control: cacheControl,
1006
1005
  });