fix: disable reasoning mode for translation to improve efficiency (#11998)

* fix: disable reasoning mode for translation to improve efficiency

- 修改 getDefaultTranslateAssistant 函数,将默认推理选项设置为 'none'
- 避免 PR #11942 引入的 'default' 选项导致翻译重新启用思考模式
- 显著提升翻译速度和性能
- 符合翻译场景不需要复杂推理的业务逻辑

* fix(AssistantService): adjust reasoning effort

Set reasoning effort to 'none' only if supported by model, otherwise use 'default'.

---------

Co-authored-by: icarus <eurfelux@gmail.com>
This commit is contained in:
George·Dong 2025-12-18 20:16:09 +08:00 committed by GitHub
parent 42260710d8
commit 8ab375161d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -74,7 +74,9 @@ export function getDefaultTranslateAssistant(
throw new Error('Unknown target language')
}
const reasoningEffort = getModelSupportedReasoningEffortOptions(model)?.[0]
const supportedOptions = getModelSupportedReasoningEffortOptions(model)
// disable reasoning if it could be disabled, otherwise no configuration
const reasoningEffort = supportedOptions?.includes('none') ? 'none' : 'default'
const settings = {
temperature: 0.7,
reasoning_effort: reasoningEffort,