From c4c89e8e1b59e6a24451cc2d4a69280ecbecbad7 Mon Sep 17 00:00:00 2001 From: Martial BE Date: Thu, 28 Dec 2023 16:49:31 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20change=20gemini=20safety=20setti?= =?UTF-8?q?ngs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- providers/gemini/chat.go | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/providers/gemini/chat.go b/providers/gemini/chat.go index 72d218b2..57de101b 100644 --- a/providers/gemini/chat.go +++ b/providers/gemini/chat.go @@ -63,24 +63,24 @@ func (response *GeminiChatResponse) ResponseHandler(resp *http.Response) (OpenAI func (p *GeminiProvider) getChatRequestBody(request *types.ChatCompletionRequest) (requestBody *GeminiChatRequest, errWithCode *types.OpenAIErrorWithStatusCode) { geminiRequest := GeminiChatRequest{ Contents: make([]GeminiChatContent, 0, len(request.Messages)), - //SafetySettings: []GeminiChatSafetySettings{ - // { - // Category: "HARM_CATEGORY_HARASSMENT", - // Threshold: "BLOCK_ONLY_HIGH", - // }, - // { - // Category: "HARM_CATEGORY_HATE_SPEECH", - // Threshold: "BLOCK_ONLY_HIGH", - // }, - // { - // Category: "HARM_CATEGORY_SEXUALLY_EXPLICIT", - // Threshold: "BLOCK_ONLY_HIGH", - // }, - // { - // Category: "HARM_CATEGORY_DANGEROUS_CONTENT", - // Threshold: "BLOCK_ONLY_HIGH", - // }, - //}, + SafetySettings: []GeminiChatSafetySettings{ + { + Category: "HARM_CATEGORY_HARASSMENT", + Threshold: "BLOCK_NONE", + }, + { + Category: "HARM_CATEGORY_HATE_SPEECH", + Threshold: "BLOCK_NONE", + }, + { + Category: "HARM_CATEGORY_SEXUALLY_EXPLICIT", + Threshold: "BLOCK_NONE", + }, + { + Category: "HARM_CATEGORY_DANGEROUS_CONTENT", + Threshold: "BLOCK_NONE", + }, + }, GenerationConfig: GeminiChatGenerationConfig{ Temperature: request.Temperature, TopP: request.TopP,