From 8d20c67b73b6bc03b753e352661cd514239d3e1a Mon Sep 17 00:00:00 2001 From: MartialBE Date: Tue, 28 Jan 2025 12:15:16 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20fix:=20Refine=20Gemini=20safety?= =?UTF-8?q?=20threshold=20detection?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- providers/gemini/chat.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/gemini/chat.go b/providers/gemini/chat.go index ca9582850..8cca205b9 100644 --- a/providers/gemini/chat.go +++ b/providers/gemini/chat.go @@ -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" }