feat(translator): map output_config.effort to adaptive thinking level in antigravity
This commit is contained in:
@@ -441,9 +441,19 @@ func ConvertClaudeRequestToAntigravity(modelName string, inputRawJSON []byte, _
|
|||||||
out, _ = sjson.Set(out, "request.generationConfig.thinkingConfig.includeThoughts", true)
|
out, _ = sjson.Set(out, "request.generationConfig.thinkingConfig.includeThoughts", true)
|
||||||
}
|
}
|
||||||
case "adaptive", "auto":
|
case "adaptive", "auto":
|
||||||
// Keep adaptive/auto as a high level sentinel; ApplyThinking resolves it
|
// Adaptive/auto thinking:
|
||||||
// to model-specific max capability.
|
// - If output_config.effort is present, pass it through as thinkingLevel.
|
||||||
out, _ = sjson.Set(out, "request.generationConfig.thinkingConfig.thinkingLevel", "high")
|
// - Otherwise, default to "high".
|
||||||
|
// ApplyThinking later normalizes/clamps and may convert level → budget per target model.
|
||||||
|
effort := ""
|
||||||
|
if v := gjson.GetBytes(rawJSON, "output_config.effort"); v.Exists() && v.Type == gjson.String {
|
||||||
|
effort = strings.ToLower(strings.TrimSpace(v.String()))
|
||||||
|
}
|
||||||
|
if effort != "" {
|
||||||
|
out, _ = sjson.Set(out, "request.generationConfig.thinkingConfig.thinkingLevel", effort)
|
||||||
|
} else {
|
||||||
|
out, _ = sjson.Set(out, "request.generationConfig.thinkingConfig.thinkingLevel", "high")
|
||||||
|
}
|
||||||
out, _ = sjson.Set(out, "request.generationConfig.thinkingConfig.includeThoughts", true)
|
out, _ = sjson.Set(out, "request.generationConfig.thinkingConfig.includeThoughts", true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user