@ai-sdk/anthropic 3.0.139 → 3.0.140
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 +8 -0
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -3
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +8 -2
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +8 -2
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/anthropic-messages-language-model.ts +9 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/anthropic",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.140",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@ai-sdk/provider": "3.0.19",
|
|
40
|
-
"@ai-sdk/provider-utils": "4.0.
|
|
40
|
+
"@ai-sdk/provider-utils": "4.0.65"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "20.17.24",
|
|
@@ -1108,13 +1108,20 @@ export class AnthropicMessagesLanguageModel implements LanguageModelV3 {
|
|
|
1108
1108
|
);
|
|
1109
1109
|
|
|
1110
1110
|
// Forced-choice and JSON-tool fallbacks restrict the declared tools.
|
|
1111
|
-
//
|
|
1112
|
-
// restore other tools before the provider executes the request.
|
|
1111
|
+
// MCP connectors and inline definitions, including those replayed from
|
|
1112
|
+
// history, must not restore other tools before the provider executes the request.
|
|
1113
1113
|
if (
|
|
1114
1114
|
(toolChoice?.type === 'tool' &&
|
|
1115
1115
|
(anthropicToolChoice?.type === 'auto' || jsonResponseTool != null)) ||
|
|
1116
1116
|
(toolChoice?.type === 'none' && jsonResponseTool != null)
|
|
1117
1117
|
) {
|
|
1118
|
+
for (const server of baseArgs.mcp_servers ?? []) {
|
|
1119
|
+
server.tool_configuration = {
|
|
1120
|
+
allowed_tools: server.tool_configuration?.allowed_tools,
|
|
1121
|
+
enabled: false,
|
|
1122
|
+
};
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1118
1125
|
// Initial system tool changes are ignored by the prompt converter.
|
|
1119
1126
|
// Validate only definitions that remain in the outgoing messages.
|
|
1120
1127
|
const emittedInlineDefinitions = new Set(
|