fix: cohere SafetyMode

This commit is contained in:
CalciumIon
2024-09-11 19:12:32 +08:00
parent 5cab06d1ce
commit d168a685c1
2 changed files with 4 additions and 2 deletions

View File

@@ -22,7 +22,9 @@ func requestOpenAI2Cohere(textRequest dto.GeneralOpenAIRequest) *CohereRequest {
Message: "",
Stream: textRequest.Stream,
MaxTokens: textRequest.GetMaxTokens(),
SafetyMode: common.CohereSafetySetting,
}
if common.CohereSafetySetting != "NONE" {
cohereReq.SafetyMode = common.CohereSafetySetting
}
if cohereReq.MaxTokens == 0 {
cohereReq.MaxTokens = 4000