[UPDATE] 优化思考预算逻辑与代码结构

🧠 refactor(antigravity): 完善 thinking 预算分配策略并重构工具构建逻辑
This commit is contained in:
SilentFlower
2026-02-11 10:39:54 +08:00
parent 19cca11e00
commit 6ae82e04d5
2 changed files with 2 additions and 3 deletions

View File

@@ -28,7 +28,7 @@ type ClaudeMessage struct {
// ThinkingConfig Thinking 配置
type ThinkingConfig struct {
Type string `json:"type"` // "enabled" / "adaptive" / "disabled"
BudgetTokens int `json:"budget_tokens,omitempty"` // thinking budget-1 表示动态预算)
BudgetTokens int `json:"budget_tokens,omitempty"` // thinking budget
}
// ClaudeMetadata 请求元数据

View File

@@ -618,9 +618,8 @@ func buildGenerationConfig(req *ClaudeRequest) *GeminiGenerationConfig {
IncludeThoughts: true,
}
// - thinking.type=enabledbudget_tokens>0 用显式预算;否则使用动态预算(-1
// - thinking.type=enabledbudget_tokens>0 用显式预算
// - thinking.type=adaptive仅在 Antigravity 的 Opus 4.6 上覆写为 24576
// CLIProxyAPI 先翻译为 thinkingLevel="high",再按模型能力转换为预算值)。
budget := -1
if req.Thinking.BudgetTokens > 0 {
budget = req.Thinking.BudgetTokens