openai 强制使用 0613 模型。强制使用 16k 模型。

This commit is contained in:
quzard 2023-06-20 14:56:24 +08:00
parent 8796db7d71
commit 5ce638a4d4

View File

@ -60,6 +60,16 @@ func relayTextHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode {
} else if channelType == common.ChannelTypePaLM {
err := relayPaLM(textRequest, c)
return err
} else if channelType == common.ChannelTypeOpenAI {
// openai 强制使用 0613 模型
textRequest.Model = strings.TrimSuffix(textRequest.Model, "-0301")
textRequest.Model = strings.TrimSuffix(textRequest.Model, "-0314")
textRequest.Model = strings.TrimSuffix(textRequest.Model, "-0613")
// 强制使用 16k 模型
if textRequest.Model == "gpt-3.5-turbo" {
textRequest.Model = "gpt-3.5-turbo-16k"
}
textRequest.Model = textRequest.Model + "-0613"
}
var promptTokens int
switch relayMode {