@ai-sdk/anthropic 4.0.90 → 4.0.92

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.
@@ -5540,7 +5540,14 @@ function hasDynamicFilteringWebToolWithoutCodeExecution(tools) {
5540
5540
  function resolveAnthropicReasoningConfig({ reasoning, modelId, supportsAdaptiveThinking, supportsXhighEffort, rejectsThinkingDisabled, supportsBetweenToolsThinking, maxOutputTokensForModel, warnings }) {
5541
5541
  if (!isCustomReasoning(reasoning)) return;
5542
5542
  if (reasoning === "none") {
5543
- if (supportsBetweenToolsThinking) return { thinking: { type: "between_tools" } };
5543
+ if (supportsBetweenToolsThinking) {
5544
+ warnings.push({
5545
+ type: "compatibility",
5546
+ feature: "reasoning",
5547
+ details: `reasoning 'none' is not supported by ${modelId}; thinking cannot be disabled. Using 'between_tools' thinking, the lowest thinking setting, instead.`
5548
+ });
5549
+ return { thinking: { type: "between_tools" } };
5550
+ }
5544
5551
  if (rejectsThinkingDisabled) {
5545
5552
  warnings.push({
5546
5553
  type: "compatibility",
@@ -5559,26 +5566,23 @@ function resolveAnthropicReasoningConfig({ reasoning, modelId, supportsAdaptiveT
5559
5566
  effort: mapReasoningToProviderEffort({
5560
5567
  reasoning,
5561
5568
  effortMap: {
5562
- minimal: "low",
5563
5569
  low: "low",
5564
5570
  medium: "medium",
5565
5571
  high: "high",
5566
- xhigh: supportsXhighEffort ? "xhigh" : "max",
5572
+ ...supportsXhighEffort && { xhigh: "xhigh" },
5567
5573
  max: "max"
5568
5574
  },
5569
5575
  warnings
5570
5576
  })
5571
5577
  };
5572
- const budgetTokens = mapReasoningToProviderBudget({
5573
- reasoning,
5574
- maxOutputTokens: maxOutputTokensForModel,
5575
- maxReasoningBudget: maxOutputTokensForModel,
5576
- warnings
5577
- });
5578
- if (budgetTokens == null) return;
5579
5578
  return { thinking: {
5580
5579
  type: "enabled",
5581
- budgetTokens
5580
+ budgetTokens: mapReasoningToProviderBudget({
5581
+ reasoning,
5582
+ maxOutputTokens: maxOutputTokensForModel,
5583
+ maxReasoningBudget: maxOutputTokensForModel,
5584
+ warnings
5585
+ })
5582
5586
  } };
5583
5587
  }
5584
5588
  function mapAnthropicResponseContextManagement(contextManagement) {