@ai-sdk/anthropic 3.0.89 → 3.0.91
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.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -6
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +1 -1
- package/dist/internal/index.d.ts +1 -1
- package/dist/internal/index.js +7 -5
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +7 -5
- package/dist/internal/index.mjs.map +1 -1
- package/docs/05-anthropic.mdx +2 -1
- package/package.json +3 -3
- package/src/anthropic-messages-language-model.ts +14 -4
- package/src/anthropic-messages-options.ts +1 -0
package/dist/internal/index.mjs
CHANGED
|
@@ -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:
|
|
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.
|
|
4952
|
-
delta = `{"type": "
|
|
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",
|
|
@@ -5178,7 +5180,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
5178
5180
|
}
|
|
5179
5181
|
};
|
|
5180
5182
|
function getModelCapabilities(modelId) {
|
|
5181
|
-
if (modelId.includes("claude-opus-4-8") || modelId.includes("claude-opus-4-7") || modelId.includes("claude-fable-5")) {
|
|
5183
|
+
if (modelId.includes("claude-opus-4-8") || modelId.includes("claude-opus-4-7") || modelId.includes("claude-fable-5") || modelId.includes("claude-sonnet-5")) {
|
|
5182
5184
|
return {
|
|
5183
5185
|
maxOutputTokens: 128e3,
|
|
5184
5186
|
supportsStructuredOutput: true,
|