mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-03 04:50:52 +08:00
Suppress debug logs for model routing and ignore empty tools arrays
- Comment out verbose routing logs in the API server to reduce noise. - Remove the `tools` field from Qwen client requests when it is an empty array. - Add guards in Claude, Codex, Gemini‑CLI, and Gemini translators to skip tool conversion when the `tools` array is empty, preventing unnecessary payload modifications.
This commit is contained in:
@@ -215,7 +215,7 @@ func ConvertOpenAIRequestToGemini(modelName string, rawJSON []byte, _ bool) []by
|
||||
|
||||
// tools -> tools[0].functionDeclarations
|
||||
tools := gjson.GetBytes(rawJSON, "tools")
|
||||
if tools.IsArray() {
|
||||
if tools.IsArray() && len(tools.Array()) > 0 {
|
||||
out, _ = sjson.SetRawBytes(out, "tools", []byte(`[{"functionDeclarations":[]}]`))
|
||||
fdPath := "tools.0.functionDeclarations"
|
||||
for _, t := range tools.Array() {
|
||||
|
||||
Reference in New Issue
Block a user