Skip to content

Commit

Permalink
🔧 fix: Refine Gemini safety threshold detection
Browse files Browse the repository at this point in the history
- Added additional check to prevent "OFF" threshold for Gemini models with "thinking" in the name
- Maintained existing safety threshold logic for Gemini 2.0 models
  • Loading branch information
MartialBE committed Jan 28, 2025
1 parent b38afb2 commit 8d20c67
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion providers/gemini/chat.go
Original file line number Diff line number Diff line change
@@ -122,7 +122,7 @@ func ConvertFromChatOpenai(request *types.ChatCompletionRequest) (*GeminiChatReq

threshold := "BLOCK_NONE"

if strings.HasPrefix(request.Model, "gemini-2.0") {
if strings.HasPrefix(request.Model, "gemini-2.0") && !strings.Contains(request.Model, "thinking") {
threshold = "OFF"
}

0 comments on commit 8d20c67

Please # to comment.