mirror of
https://github.com/githubhjs/CLIProxyAPIPlus.git
synced 2026-07-12 01:25:13 +00:00
Merge branch 'router-for-me:main' into main
This commit is contained in:
@@ -728,7 +728,7 @@ func geminiToAntigravity(modelName string, payload []byte, projectID string) []b
|
|||||||
|
|
||||||
template, _ = sjson.Delete(template, "request.safetySettings")
|
template, _ = sjson.Delete(template, "request.safetySettings")
|
||||||
template, _ = sjson.Set(template, "request.toolConfig.functionCallingConfig.mode", "VALIDATED")
|
template, _ = sjson.Set(template, "request.toolConfig.functionCallingConfig.mode", "VALIDATED")
|
||||||
template, _ = sjson.Delete(template, "request.generationConfig.maxOutputTokens")
|
|
||||||
if !strings.HasPrefix(modelName, "gemini-3-") {
|
if !strings.HasPrefix(modelName, "gemini-3-") {
|
||||||
if thinkingLevel := gjson.Get(template, "request.generationConfig.thinkingConfig.thinkingLevel"); thinkingLevel.Exists() {
|
if thinkingLevel := gjson.Get(template, "request.generationConfig.thinkingConfig.thinkingLevel"); thinkingLevel.Exists() {
|
||||||
template, _ = sjson.Delete(template, "request.generationConfig.thinkingConfig.thinkingLevel")
|
template, _ = sjson.Delete(template, "request.generationConfig.thinkingConfig.thinkingLevel")
|
||||||
@@ -736,7 +736,7 @@ func geminiToAntigravity(modelName string, payload []byte, projectID string) []b
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if strings.HasPrefix(modelName, "claude-sonnet-") {
|
if strings.Contains(modelName, "claude") {
|
||||||
gjson.Get(template, "request.tools").ForEach(func(key, tool gjson.Result) bool {
|
gjson.Get(template, "request.tools").ForEach(func(key, tool gjson.Result) bool {
|
||||||
tool.Get("functionDeclarations").ForEach(func(funKey, funcDecl gjson.Result) bool {
|
tool.Get("functionDeclarations").ForEach(func(funKey, funcDecl gjson.Result) bool {
|
||||||
if funcDecl.Get("parametersJsonSchema").Exists() {
|
if funcDecl.Get("parametersJsonSchema").Exists() {
|
||||||
@@ -748,6 +748,8 @@ func geminiToAntigravity(modelName string, payload []byte, projectID string) []b
|
|||||||
})
|
})
|
||||||
return true
|
return true
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
template, _ = sjson.Delete(template, "request.generationConfig.maxOutputTokens")
|
||||||
}
|
}
|
||||||
|
|
||||||
return []byte(template)
|
return []byte(template)
|
||||||
|
|||||||
@@ -181,6 +181,9 @@ func ConvertClaudeRequestToAntigravity(modelName string, inputRawJSON []byte, _
|
|||||||
if v := gjson.GetBytes(rawJSON, "top_k"); v.Exists() && v.Type == gjson.Number {
|
if v := gjson.GetBytes(rawJSON, "top_k"); v.Exists() && v.Type == gjson.Number {
|
||||||
out, _ = sjson.Set(out, "request.generationConfig.topK", v.Num)
|
out, _ = sjson.Set(out, "request.generationConfig.topK", v.Num)
|
||||||
}
|
}
|
||||||
|
if v := gjson.GetBytes(rawJSON, "max_tokens"); v.Exists() && v.Type == gjson.Number {
|
||||||
|
out, _ = sjson.Set(out, "request.generationConfig.maxOutputTokens", v.Num)
|
||||||
|
}
|
||||||
|
|
||||||
outBytes := []byte(out)
|
outBytes := []byte(out)
|
||||||
outBytes = common.AttachDefaultSafetySettings(outBytes, "request.safetySettings")
|
outBytes = common.AttachDefaultSafetySettings(outBytes, "request.safetySettings")
|
||||||
|
|||||||
Reference in New Issue
Block a user