Skip to content

[FEATURE] 支持关闭 Gemini 模型思考模式 #1288

@solanab

Description

@solanab

📋 Feature Description

支持通过配置控制 Gemini 模型的思考模式(Thinking Mode),允许用户关闭或限制思考 token 预算。

🎯 Problem to Solve

Gemini 2.0 Flash Thinking 等模型默认启用思考模式,会消耗额外 token 并增加延迟。某些场景下用户希望关闭思考以降低成本和响应时间。

💡 Proposed Solution

在请求中添加 thinkingConfig 参数:

{
  "thinkingConfig": {
    "thinkingBudget": 0
  }
}
  • 0 = 关闭思考
  • 正整数 = 限制思考 token 数量

🔧 Technical Details

  • mcp/request.go: 添加 ThinkingConfig 结构体字段
  • mcp/config.go: 添加配置选项
  • 前端: AI 模型配置页面添加开关

✅ Acceptance Criteria

  • Request 结构支持 thinkingConfig 参数
  • 用户可通过配置或 UI 控制思考模式
  • 仅对支持思考的 Gemini 模型生效

📚 Additional Context

符合 Roadmap 1.2 增强AI能力方向。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions