Skip to content

Commit

Permalink
gemini: Adjust safety filters - new value "OFF" and new category "HAR…
Browse files Browse the repository at this point in the history
…M_CATEGORY_CIVIC_INTEGRITY"
  • Loading branch information
Brawl345 committed Jan 9, 2025
1 parent 0eec16a commit 251d348
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions plugin/gemini/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ type (
}

SafetySetting struct {
Category string `json:"category"`
Threshold string `json:"threshold"`
Category string `json:"category"` // https://ai.google.dev/api/generate-content#v1beta.HarmCategory
Threshold string `json:"threshold"` // https://ai.google.dev/api/generate-content#HarmBlockThreshold
}

GenerationConfig struct {
Expand Down
12 changes: 8 additions & 4 deletions plugin/gemini/gemini.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,19 +237,23 @@ func (p *Plugin) onGemini(b *gotgbot.Bot, c plugin.GobotContext) error {
SafetySettings: []SafetySetting{
{
Category: "HARM_CATEGORY_HARASSMENT",
Threshold: "BLOCK_NONE",
Threshold: "OFF",
},
{
Category: "HARM_CATEGORY_HATE_SPEECH",
Threshold: "BLOCK_NONE",
Threshold: "OFF",
},
{
Category: "HARM_CATEGORY_SEXUALLY_EXPLICIT",
Threshold: "BLOCK_NONE",
Threshold: "OFF",
},
{
Category: "HARM_CATEGORY_DANGEROUS_CONTENT",
Threshold: "BLOCK_NONE",
Threshold: "OFF",
},
{
Category: "HARM_CATEGORY_CIVIC_INTEGRITY",
Threshold: "OFF",
},
},
GenerationConfig: GenerationConfig{
Expand Down

0 comments on commit 251d348

Please sign in to comment.