Update Cohere Safety Setting

This commit is contained in:
HynoR
2024-09-02 06:47:49 +07:00
parent 4b1e83c42d
commit 0b4317ce28
4 changed files with 7 additions and 1 deletions

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 {

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
}