@ai-sdk/anthropic 4.0.6 → 4.0.8

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,22 @@
1
1
  # @ai-sdk/anthropic
2
2
 
3
+ ## 4.0.8
4
+
5
+ ### Patch Changes
6
+
7
+ - 0aa0ff3: fix(anthropic): forward `thinking: { type: 'disabled' }` to the API instead of stripping it
8
+
9
+ Previously, setting `providerOptions.anthropic.thinking = { type: 'disabled' }` (or top-level `reasoning: 'none'`) 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
+
11
+ ## 4.0.7
12
+
13
+ ### Patch Changes
14
+
15
+ - 5c5c0f5: Add experimental streaming transcription support for transcription models, including OpenAI `gpt-realtime-whisper` and xAI WebSocket STT.
16
+ - Updated dependencies [5c5c0f5]
17
+ - @ai-sdk/provider@4.0.2
18
+ - @ai-sdk/provider-utils@5.0.5
19
+
3
20
  ## 4.0.6
4
21
 
5
22
  ### Patch Changes
package/dist/index.js CHANGED
@@ -3710,6 +3710,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
3710
3710
  }
3711
3711
  const thinkingType = (_f = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _f.type;
3712
3712
  const isThinking = thinkingType === "enabled" || thinkingType === "adaptive";
3713
+ const sendThinking = isThinking || thinkingType === "disabled";
3713
3714
  let thinkingBudget = thinkingType === "enabled" ? (_g = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _g.budgetTokens : void 0;
3714
3715
  const thinkingDisplay = thinkingType === "adaptive" ? (_h = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _h.display : void 0;
3715
3716
  const maxTokens = maxOutputTokens != null ? maxOutputTokens : maxOutputTokensForModel;
@@ -3723,7 +3724,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
3723
3724
  top_p: topP,
3724
3725
  stop_sequences: stopSequences,
3725
3726
  // provider specific settings:
3726
- ...isThinking && {
3727
+ ...sendThinking && {
3727
3728
  thinking: {
3728
3729
  type: thinkingType,
3729
3730
  ...thinkingBudget != null && { budget_tokens: thinkingBudget },
@@ -6291,7 +6292,7 @@ var AnthropicSkills = class {
6291
6292
  };
6292
6293
 
6293
6294
  // src/version.ts
6294
- var VERSION = true ? "4.0.6" : "0.0.0-test";
6295
+ var VERSION = true ? "4.0.8" : "0.0.0-test";
6295
6296
 
6296
6297
  // src/anthropic-provider.ts
6297
6298
  var ANTHROPIC_API_URL = "https://api.anthropic.com";