@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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # @ai-sdk/anthropic
2
2
 
3
+ ## 3.0.140
4
+
5
+ ### Patch Changes
6
+
7
+ - c8feb7c: Disable MCP connector tools when structured output falls back to the JSON response tool and the caller selects no tools or a named application tool, and when a named application tool choice falls back to automatic tool selection.
8
+ - Updated dependencies [f0dee4b]
9
+ - @ai-sdk/provider-utils@4.0.65
10
+
3
11
  ## 3.0.139
4
12
 
5
13
  ### Patch Changes
package/dist/index.js CHANGED
@@ -32,7 +32,7 @@ var import_provider4 = require("@ai-sdk/provider");
32
32
  var import_provider_utils28 = require("@ai-sdk/provider-utils");
33
33
 
34
34
  // src/version.ts
35
- var VERSION = true ? "3.0.139" : "0.0.0-test";
35
+ var VERSION = true ? "3.0.140" : "0.0.0-test";
36
36
 
37
37
  // src/anthropic-messages-language-model.ts
38
38
  var import_provider3 = require("@ai-sdk/provider");
@@ -4119,7 +4119,7 @@ var AnthropicMessagesLanguageModel = class {
4119
4119
  providerOptions,
4120
4120
  stream
4121
4121
  }) {
4122
- var _a, _b, _c, _d, _e, _f, _g, _h;
4122
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
4123
4123
  const warnings = [];
4124
4124
  if (frequencyPenalty != null) {
4125
4125
  warnings.push({ type: "unsupported", feature: "frequencyPenalty" });
@@ -4665,6 +4665,12 @@ var AnthropicMessagesLanguageModel = class {
4665
4665
  }
4666
4666
  );
4667
4667
  if ((toolChoice == null ? void 0 : toolChoice.type) === "tool" && ((anthropicToolChoice == null ? void 0 : anthropicToolChoice.type) === "auto" || jsonResponseTool != null) || (toolChoice == null ? void 0 : toolChoice.type) === "none" && jsonResponseTool != null) {
4668
+ for (const server of (_h = baseArgs.mcp_servers) != null ? _h : []) {
4669
+ server.tool_configuration = {
4670
+ allowed_tools: (_i = server.tool_configuration) == null ? void 0 : _i.allowed_tools,
4671
+ enabled: false
4672
+ };
4673
+ }
4668
4674
  const emittedInlineDefinitions = new Set(
4669
4675
  messagesPrompt.messages.flatMap(
4670
4676
  (message) => message.role === "system" ? message.content.flatMap(
@@ -4703,7 +4709,7 @@ var AnthropicMessagesLanguageModel = class {
4703
4709
  ...betas,
4704
4710
  ...toolsBetas,
4705
4711
  ...userSuppliedBetas,
4706
- ...(_h = anthropicOptions == null ? void 0 : anthropicOptions.anthropicBeta) != null ? _h : []
4712
+ ...(_j = anthropicOptions == null ? void 0 : anthropicOptions.anthropicBeta) != null ? _j : []
4707
4713
  ]),
4708
4714
  usesJsonResponseTool: jsonResponseTool != null,
4709
4715
  toolNameMapping,