@ai-sdk/anthropic 3.0.89 → 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.
package/dist/index.mjs CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  } from "@ai-sdk/provider-utils";
13
13
 
14
14
  // src/version.ts
15
- var VERSION = true ? "3.0.89" : "0.0.0-test";
15
+ var VERSION = true ? "3.0.90" : "0.0.0-test";
16
16
 
17
17
  // src/anthropic-messages-language-model.ts
18
18
  import {
@@ -4510,6 +4510,7 @@ var AnthropicMessagesLanguageModel = class {
4510
4510
  "bash_code_execution"
4511
4511
  ].includes(part.name)) {
4512
4512
  const providerToolName = part.name === "text_editor_code_execution" || part.name === "bash_code_execution" ? "code_execution" : part.name;
4513
+ const providerToolInputType = part.name === "text_editor_code_execution" || part.name === "bash_code_execution" ? part.name : part.name === "code_execution" ? "programmatic-tool-call" : void 0;
4513
4514
  const customToolName = toolNameMapping.toCustomToolName(providerToolName);
4514
4515
  const finalInput = part.input != null && typeof part.input === "object" && Object.keys(part.input).length > 0 ? JSON.stringify(part.input) : "";
4515
4516
  contentBlocks[value.index] = {
@@ -4523,8 +4524,9 @@ var AnthropicMessagesLanguageModel = class {
4523
4524
  // tool was not explicitly provided. We therefore bypass the general validation by marking the
4524
4525
  // tool as dynamic.
4525
4526
  ...markCodeExecutionDynamic && providerToolName === "code_execution" ? { dynamic: true } : {},
4526
- firstDelta: true,
4527
- providerToolName
4527
+ firstDelta: finalInput.length === 0,
4528
+ providerToolName,
4529
+ providerToolInputType
4528
4530
  };
4529
4531
  controller.enqueue({
4530
4532
  type: "tool-input-start",
@@ -4964,8 +4966,8 @@ var AnthropicMessagesLanguageModel = class {
4964
4966
  if ((contentBlock == null ? void 0 : contentBlock.type) !== "tool-call") {
4965
4967
  return;
4966
4968
  }
4967
- if (contentBlock.firstDelta && contentBlock.providerToolName === "code_execution") {
4968
- delta = `{"type": "programmatic-tool-call",${delta.substring(1)}`;
4969
+ if (contentBlock.firstDelta && contentBlock.providerToolInputType != null) {
4970
+ delta = `{"type": "${contentBlock.providerToolInputType}",${delta.substring(1)}`;
4969
4971
  }
4970
4972
  controller.enqueue({
4971
4973
  type: "tool-input-delta",