@ai-sdk/anthropic 3.0.88 → 3.0.90

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.
@@ -4494,6 +4494,7 @@ var AnthropicMessagesLanguageModel = class {
4494
4494
  "bash_code_execution"
4495
4495
  ].includes(part.name)) {
4496
4496
  const providerToolName = part.name === "text_editor_code_execution" || part.name === "bash_code_execution" ? "code_execution" : part.name;
4497
+ const providerToolInputType = part.name === "text_editor_code_execution" || part.name === "bash_code_execution" ? part.name : part.name === "code_execution" ? "programmatic-tool-call" : void 0;
4497
4498
  const customToolName = toolNameMapping.toCustomToolName(providerToolName);
4498
4499
  const finalInput = part.input != null && typeof part.input === "object" && Object.keys(part.input).length > 0 ? JSON.stringify(part.input) : "";
4499
4500
  contentBlocks[value.index] = {
@@ -4507,8 +4508,9 @@ var AnthropicMessagesLanguageModel = class {
4507
4508
  // tool was not explicitly provided. We therefore bypass the general validation by marking the
4508
4509
  // tool as dynamic.
4509
4510
  ...markCodeExecutionDynamic && providerToolName === "code_execution" ? { dynamic: true } : {},
4510
- firstDelta: true,
4511
- providerToolName
4511
+ firstDelta: finalInput.length === 0,
4512
+ providerToolName,
4513
+ providerToolInputType
4512
4514
  };
4513
4515
  controller.enqueue({
4514
4516
  type: "tool-input-start",
@@ -4948,8 +4950,8 @@ var AnthropicMessagesLanguageModel = class {
4948
4950
  if ((contentBlock == null ? void 0 : contentBlock.type) !== "tool-call") {
4949
4951
  return;
4950
4952
  }
4951
- if (contentBlock.firstDelta && contentBlock.providerToolName === "code_execution") {
4952
- delta = `{"type": "programmatic-tool-call",${delta.substring(1)}`;
4953
+ if (contentBlock.firstDelta && contentBlock.providerToolInputType != null) {
4954
+ delta = `{"type": "${contentBlock.providerToolInputType}",${delta.substring(1)}`;
4953
4955
  }
4954
4956
  controller.enqueue({
4955
4957
  type: "tool-input-delta",