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) const result = getReasoningEffort(assistant, model)
expect(result).toEqual({ expect(result).toEqual({
enable_thinking: true, enable_thinking: true
thinking_budget: 32768
}) })
}) })

View File

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