🎨 change gemini safety settings

This commit is contained in:
Martial BE 2023-12-28 16:49:31 +08:00
parent 72983ac734
commit c4c89e8e1b
No known key found for this signature in database
GPG Key ID: D06C32DF0EDB9084

View File

@ -63,24 +63,24 @@ func (response *GeminiChatResponse) ResponseHandler(resp *http.Response) (OpenAI
func (p *GeminiProvider) getChatRequestBody(request *types.ChatCompletionRequest) (requestBody *GeminiChatRequest, errWithCode *types.OpenAIErrorWithStatusCode) { func (p *GeminiProvider) getChatRequestBody(request *types.ChatCompletionRequest) (requestBody *GeminiChatRequest, errWithCode *types.OpenAIErrorWithStatusCode) {
geminiRequest := GeminiChatRequest{ geminiRequest := GeminiChatRequest{
Contents: make([]GeminiChatContent, 0, len(request.Messages)), Contents: make([]GeminiChatContent, 0, len(request.Messages)),
//SafetySettings: []GeminiChatSafetySettings{ SafetySettings: []GeminiChatSafetySettings{
// { {
// Category: "HARM_CATEGORY_HARASSMENT", Category: "HARM_CATEGORY_HARASSMENT",
// Threshold: "BLOCK_ONLY_HIGH", Threshold: "BLOCK_NONE",
// }, },
// { {
// Category: "HARM_CATEGORY_HATE_SPEECH", Category: "HARM_CATEGORY_HATE_SPEECH",
// Threshold: "BLOCK_ONLY_HIGH", Threshold: "BLOCK_NONE",
// }, },
// { {
// Category: "HARM_CATEGORY_SEXUALLY_EXPLICIT", Category: "HARM_CATEGORY_SEXUALLY_EXPLICIT",
// Threshold: "BLOCK_ONLY_HIGH", Threshold: "BLOCK_NONE",
// }, },
// { {
// Category: "HARM_CATEGORY_DANGEROUS_CONTENT", Category: "HARM_CATEGORY_DANGEROUS_CONTENT",
// Threshold: "BLOCK_ONLY_HIGH", Threshold: "BLOCK_NONE",
// }, },
//}, },
GenerationConfig: GeminiChatGenerationConfig{ GenerationConfig: GeminiChatGenerationConfig{
Temperature: request.Temperature, Temperature: request.Temperature,
TopP: request.TopP, TopP: request.TopP,