feat: able to change gemini safety setting

This commit is contained in:
CaIon
2024-01-10 13:56:10 +08:00
parent 6a24e8953f
commit aca8d25372
4 changed files with 28 additions and 19 deletions

View File

@@ -202,6 +202,13 @@ func GetOrDefault(env string, defaultValue int) int {
return num
}
func GetOrDefaultString(env string, defaultValue string) string {
if env == "" || os.Getenv(env) == "" {
return defaultValue
}
return os.Getenv(env)
}
func MessageWithRequestId(message string, id string) string {
return fmt.Sprintf("%s (request id: %s)", message, id)
}