@ai-sdk/anthropic 4.0.1 → 4.0.2
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 +6 -0
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/internal/index.js +6 -4
- package/dist/internal/index.js.map +1 -1
- package/package.json +1 -1
- package/src/anthropic-language-model.ts +12 -3
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -4704,6 +4704,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4704
4704
|
"bash_code_execution"
|
|
4705
4705
|
].includes(part.name)) {
|
|
4706
4706
|
const providerToolName = part.name === "text_editor_code_execution" || part.name === "bash_code_execution" ? "code_execution" : part.name;
|
|
4707
|
+
const providerToolInputType = part.name === "text_editor_code_execution" || part.name === "bash_code_execution" ? part.name : part.name === "code_execution" ? "programmatic-tool-call" : void 0;
|
|
4707
4708
|
const customToolName = toolNameMapping.toCustomToolName(providerToolName);
|
|
4708
4709
|
const finalInput = part.input != null && typeof part.input === "object" && Object.keys(part.input).length > 0 ? JSON.stringify(part.input) : "";
|
|
4709
4710
|
contentBlocks[value.index] = {
|
|
@@ -4717,8 +4718,9 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4717
4718
|
// tool was not explicitly provided. We therefore bypass the general validation by marking the
|
|
4718
4719
|
// tool as dynamic.
|
|
4719
4720
|
...markCodeExecutionDynamic && providerToolName === "code_execution" ? { dynamic: true } : {},
|
|
4720
|
-
firstDelta:
|
|
4721
|
-
providerToolName
|
|
4721
|
+
firstDelta: finalInput.length === 0,
|
|
4722
|
+
providerToolName,
|
|
4723
|
+
providerToolInputType
|
|
4722
4724
|
};
|
|
4723
4725
|
controller.enqueue({
|
|
4724
4726
|
type: "tool-input-start",
|
|
@@ -5158,8 +5160,8 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5158
5160
|
if ((contentBlock == null ? void 0 : contentBlock.type) !== "tool-call") {
|
|
5159
5161
|
return;
|
|
5160
5162
|
}
|
|
5161
|
-
if (contentBlock.firstDelta && contentBlock.
|
|
5162
|
-
delta = `{"type": "
|
|
5163
|
+
if (contentBlock.firstDelta && contentBlock.providerToolInputType != null) {
|
|
5164
|
+
delta = `{"type": "${contentBlock.providerToolInputType}",${delta.substring(1)}`;
|
|
5163
5165
|
}
|
|
5164
5166
|
controller.enqueue({
|
|
5165
5167
|
type: "tool-input-delta",
|
|
@@ -6287,7 +6289,7 @@ var AnthropicSkills = class {
|
|
|
6287
6289
|
};
|
|
6288
6290
|
|
|
6289
6291
|
// src/version.ts
|
|
6290
|
-
var VERSION = true ? "4.0.
|
|
6292
|
+
var VERSION = true ? "4.0.2" : "0.0.0-test";
|
|
6291
6293
|
|
|
6292
6294
|
// src/anthropic-provider.ts
|
|
6293
6295
|
function createAnthropic(options = {}) {
|