mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-27 12:51:26 +08:00
parent
04cbeab1d9
commit
119125038d
@ -10,6 +10,7 @@ import {
|
||||
isSupportedReasoningEffortModel,
|
||||
isSupportedReasoningEffortOpenAIModel,
|
||||
isSupportedThinkingTokenClaudeModel,
|
||||
isSupportedThinkingTokenGeminiModel,
|
||||
isSupportedThinkingTokenModel,
|
||||
isSupportedThinkingTokenQwenModel,
|
||||
isVisionModel,
|
||||
@ -258,6 +259,19 @@ export default class OpenAIProvider extends BaseOpenAIProvider {
|
||||
return { thinking: { type: 'disabled' } }
|
||||
}
|
||||
|
||||
if (isSupportedThinkingTokenGeminiModel(model)) {
|
||||
// openrouter没有提供一个不推理的选项,先隐藏
|
||||
if (this.provider.id === 'openrouter') {
|
||||
return { reasoning: { maxTokens: 0, exclude: true } }
|
||||
}
|
||||
return {
|
||||
thinkingConfig: {
|
||||
includeThoughts: false,
|
||||
thinkingBudget: 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {}
|
||||
}
|
||||
const effortRatio = EFFORT_RATIO[reasoningEffort]
|
||||
@ -313,6 +327,16 @@ export default class OpenAIProvider extends BaseOpenAIProvider {
|
||||
}
|
||||
}
|
||||
|
||||
// Gemini models
|
||||
if (isSupportedThinkingTokenGeminiModel(model)) {
|
||||
return {
|
||||
thinkingConfig: {
|
||||
thinkingBudget: budgetTokens,
|
||||
includeThoughts: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Default case: no special thinking settings
|
||||
return {}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user