fix: token 取整 (#6300)

This commit is contained in:
SuYao 2025-05-22 14:13:28 +08:00 committed by GitHub
parent bd8452032e
commit b8e978f2a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -324,7 +324,9 @@ export default class OpenAIProvider extends BaseOpenAIProvider {
return {
thinking: {
type: 'enabled',
budget_tokens: Math.max(1024, Math.min(budgetTokens, (maxTokens || DEFAULT_MAX_TOKENS) * effortRatio))
budget_tokens: Math.floor(
Math.max(1024, Math.min(budgetTokens, (maxTokens || DEFAULT_MAX_TOKENS) * effortRatio))
)
}
}
}