Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
陈曦
sub2api
Commits
6ae82e04
Commit
6ae82e04
authored
Feb 11, 2026
by
SilentFlower
Browse files
[UPDATE] 优化思考预算逻辑与代码结构
🧠 refactor(antigravity): 完善 thinking 预算分配策略并重构工具构建逻辑
parent
19cca11e
Changes
2
Show whitespace changes
Inline
Side-by-side
backend/internal/pkg/antigravity/claude_types.go
View file @
6ae82e04
...
...
@@ -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 请求元数据
...
...
backend/internal/pkg/antigravity/request_transformer.go
View file @
6ae82e04
...
...
@@ -618,9 +618,8 @@ func buildGenerationConfig(req *ClaudeRequest) *GeminiGenerationConfig {
IncludeThoughts
:
true
,
}
// - thinking.type=enabled:budget_tokens>0 用显式预算
;否则使用动态预算(-1)
// - thinking.type=enabled:budget_tokens>0 用显式预算
// - thinking.type=adaptive:仅在 Antigravity 的 Opus 4.6 上覆写为 (24576)
// (CLIProxyAPI 先翻译为 thinkingLevel="high",再按模型能力转换为预算值)。
budget
:=
-
1
if
req
.
Thinking
.
BudgetTokens
>
0
{
budget
=
req
.
Thinking
.
BudgetTokens
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment