feat: able to change gemini safety setting (#867)

* perf: adjust gemini safety settings, set BLOCK_NONE by default

* feat: able to adjust by env variable

---------

Co-authored-by: JustSong <songquanpeng@foxmail.com>
This commit is contained in:
Tisfeng
2024-01-01 16:42:19 +08:00
committed by GitHub
parent d8029550f7
commit af8908db54
4 changed files with 28 additions and 18 deletions

View File

@@ -196,6 +196,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)
}