Update Cohere Safety Setting

This commit is contained in:
HynoR
2024-09-02 06:47:49 +07:00
parent 062eeb7f72
commit b7b5887b0e
4 changed files with 7 additions and 1 deletions
+1
View File
@@ -8,6 +8,7 @@ type CohereRequest struct {
Message string `json:"message"`
Stream bool `json:"stream"`
MaxTokens int `json:"max_tokens"`
SafetyMode string `json:"safety_mode"`
}
type ChatHistory struct {
+2
View File
@@ -22,6 +22,7 @@ func requestOpenAI2Cohere(textRequest dto.GeneralOpenAIRequest) *CohereRequest {
Message: "",
Stream: textRequest.Stream,
MaxTokens: textRequest.GetMaxTokens(),
SafetyMode: common.CohereSafetySetting,
}
if cohereReq.MaxTokens == 0 {
cohereReq.MaxTokens = 4000
@@ -44,6 +45,7 @@ func requestOpenAI2Cohere(textRequest dto.GeneralOpenAIRequest) *CohereRequest {
})
}
}
return &cohereReq
}