feat(gemini): apply default safety settings across request translators

This commit is contained in:
hkfires
2025-10-31 08:20:47 +08:00
parent a517290726
commit a53c84d0d1
9 changed files with 75 additions and 8 deletions

View File

@@ -4,6 +4,7 @@ import (
"bytes"
"strings"
"github.com/router-for-me/CLIProxyAPI/v6/internal/translator/gemini/common"
"github.com/router-for-me/CLIProxyAPI/v6/internal/util"
"github.com/tidwall/gjson"
"github.com/tidwall/sjson"
@@ -291,5 +292,7 @@ func ConvertOpenAIResponsesRequestToGemini(modelName string, inputRawJSON []byte
}
}
}
return []byte(out)
result := []byte(out)
result = common.AttachDefaultSafetySettings(result, "safetySettings")
return result
}