fix(test): reasoning

This commit is contained in:
suyao 2025-12-18 02:51:36 +08:00
parent ec84485ee9
commit 0a63540160
No known key found for this signature in database
2 changed files with 3 additions and 4 deletions

View File

@ -368,8 +368,7 @@ describe('reasoning utils', () => {
const result = getReasoningEffort(assistant, model)
expect(result).toEqual({
enable_thinking: true,
thinking_budget: 32768
enable_thinking: true
})
})

View File

@ -480,12 +480,12 @@ export function getAnthropicThinkingBudget(
}
const budget = Math.floor((tokenLimit.max - tokenLimit.min) * effortRatio + tokenLimit.min)
let budgetTokens = budget
if (maxTokens !== undefined) {
budgetTokens = Math.min(budget, maxTokens)
}
return Math.max(1024, budgetTokens)
}