merge upstream

Signed-off-by: wozulong <>
This commit is contained in:
wozulong
2024-09-10 17:28:04 +08:00
6 changed files with 17 additions and 9 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
}