@ai-sdk/anthropic 3.0.0-beta.77 → 3.0.0-beta.78

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.
@@ -2227,7 +2227,7 @@ var AnthropicMessagesLanguageModel = class {
2227
2227
  toolNameMapping
2228
2228
  });
2229
2229
  const isThinking = ((_c = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _c.type) === "enabled";
2230
- const thinkingBudget = (_d = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _d.budgetTokens;
2230
+ let thinkingBudget = (_d = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _d.budgetTokens;
2231
2231
  const maxTokens = maxOutputTokens != null ? maxOutputTokens : maxOutputTokensForModel;
2232
2232
  const baseArgs = {
2233
2233
  // model id:
@@ -2319,9 +2319,16 @@ var AnthropicMessagesLanguageModel = class {
2319
2319
  };
2320
2320
  if (isThinking) {
2321
2321
  if (thinkingBudget == null) {
2322
- throw new import_provider3.UnsupportedFunctionalityError({
2323
- functionality: "thinking requires a budget"
2322
+ warnings.push({
2323
+ type: "compatibility",
2324
+ feature: "extended thinking",
2325
+ details: "thinking budget is required when thinking is enabled. using default budget of 1024 tokens."
2324
2326
  });
2327
+ baseArgs.thinking = {
2328
+ type: "enabled",
2329
+ budget_tokens: 1024
2330
+ };
2331
+ thinkingBudget = 1024;
2325
2332
  }
2326
2333
  if (baseArgs.temperature != null) {
2327
2334
  baseArgs.temperature = void 0;
@@ -2347,7 +2354,7 @@ var AnthropicMessagesLanguageModel = class {
2347
2354
  details: "topP is not supported when thinking is enabled"
2348
2355
  });
2349
2356
  }
2350
- baseArgs.max_tokens = maxTokens + thinkingBudget;
2357
+ baseArgs.max_tokens = maxTokens + (thinkingBudget != null ? thinkingBudget : 0);
2351
2358
  }
2352
2359
  if (isKnownModel && baseArgs.max_tokens > maxOutputTokensForModel) {
2353
2360
  if (maxOutputTokens != null) {