@ai-sdk/anthropic 3.0.92 → 3.0.93

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.93
4
+
5
+ ### Patch Changes
6
+
7
+ - 4241b49: fix(anthropic): forward `thinking: { type: 'disabled' }` to the API instead of stripping it
8
+
9
+ Previously, setting `providerOptions.anthropic.thinking = { type: 'disabled' }` was accepted by the schema but silently dropped from the outgoing request. For models that default thinking on (e.g. Sonnet 5), this left thinking enabled and could consume a small `max_tokens` budget entirely. The `disabled` value is now sent to the Anthropic Messages API.
10
+
3
11
  ## 3.0.92
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_utils26 = require("@ai-sdk/provider-utils");
33
33
 
34
34
  // src/version.ts
35
- var VERSION = true ? "3.0.92" : "0.0.0-test";
35
+ var VERSION = true ? "3.0.93" : "0.0.0-test";
36
36
 
37
37
  // src/anthropic-messages-language-model.ts
38
38
  var import_provider3 = require("@ai-sdk/provider");
@@ -3465,6 +3465,7 @@ var AnthropicMessagesLanguageModel = class {
3465
3465
  });
3466
3466
  const thinkingType = (_e = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _e.type;
3467
3467
  const isThinking = thinkingType === "enabled" || thinkingType === "adaptive";
3468
+ const sendThinking = isThinking || thinkingType === "disabled";
3468
3469
  let thinkingBudget = thinkingType === "enabled" ? (_f = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _f.budgetTokens : void 0;
3469
3470
  const thinkingDisplay = thinkingType === "adaptive" ? (_g = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _g.display : void 0;
3470
3471
  const maxTokens = maxOutputTokens != null ? maxOutputTokens : maxOutputTokensForModel;
@@ -3478,7 +3479,7 @@ var AnthropicMessagesLanguageModel = class {
3478
3479
  top_p: topP,
3479
3480
  stop_sequences: stopSequences,
3480
3481
  // provider specific settings:
3481
- ...isThinking && {
3482
+ ...sendThinking && {
3482
3483
  thinking: {
3483
3484
  type: thinkingType,
3484
3485
  ...thinkingBudget != null && { budget_tokens: thinkingBudget },