perf: adjust gemini safety settings, set BLOCK_NONE by default
This commit is contained in:
parent
97030e27f8
commit
8730ccd8a0
@ -56,24 +56,24 @@ type GeminiChatGenerationConfig struct {
|
|||||||
func requestOpenAI2Gemini(textRequest GeneralOpenAIRequest) *GeminiChatRequest {
|
func requestOpenAI2Gemini(textRequest GeneralOpenAIRequest) *GeminiChatRequest {
|
||||||
geminiRequest := GeminiChatRequest{
|
geminiRequest := GeminiChatRequest{
|
||||||
Contents: make([]GeminiChatContent, 0, len(textRequest.Messages)),
|
Contents: make([]GeminiChatContent, 0, len(textRequest.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: textRequest.Temperature,
|
Temperature: textRequest.Temperature,
|
||||||
TopP: textRequest.TopP,
|
TopP: textRequest.TopP,
|
||||||
|
Loading…
Reference in New Issue
Block a user