@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 +8 -0
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -2
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +2 -1
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +2 -1
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/anthropic-messages-language-model.ts +5 -1
package/package.json
CHANGED
|
@@ -375,6 +375,10 @@ export class AnthropicMessagesLanguageModel implements LanguageModelV3 {
|
|
|
375
375
|
const thinkingType = anthropicOptions?.thinking?.type;
|
|
376
376
|
const isThinking =
|
|
377
377
|
thinkingType === 'enabled' || thinkingType === 'adaptive';
|
|
378
|
+
// `disabled` must still be forwarded to the API: some models (e.g. Sonnet 5)
|
|
379
|
+
// default thinking on, so omitting it would leave thinking enabled and
|
|
380
|
+
// consume the max_tokens budget.
|
|
381
|
+
const sendThinking = isThinking || thinkingType === 'disabled';
|
|
378
382
|
let thinkingBudget =
|
|
379
383
|
thinkingType === 'enabled'
|
|
380
384
|
? anthropicOptions?.thinking?.budgetTokens
|
|
@@ -398,7 +402,7 @@ export class AnthropicMessagesLanguageModel implements LanguageModelV3 {
|
|
|
398
402
|
stop_sequences: stopSequences,
|
|
399
403
|
|
|
400
404
|
// provider specific settings:
|
|
401
|
-
...(
|
|
405
|
+
...(sendThinking && {
|
|
402
406
|
thinking: {
|
|
403
407
|
type: thinkingType,
|
|
404
408
|
...(thinkingBudget != null && { budget_tokens: thinkingBudget }),
|