From 5ce638a4d414bdaaa9312cfef82503701385c57a Mon Sep 17 00:00:00 2001 From: quzard <1191890118@qq.com> Date: Tue, 20 Jun 2023 14:56:24 +0800 Subject: [PATCH] =?UTF-8?q?openai=20=E5=BC=BA=E5=88=B6=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=200613=20=E6=A8=A1=E5=9E=8B=E3=80=82=E5=BC=BA=E5=88=B6?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=2016k=20=E6=A8=A1=E5=9E=8B=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controller/relay-text.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/controller/relay-text.go b/controller/relay-text.go index 31da580e..73703db0 100644 --- a/controller/relay-text.go +++ b/controller/relay-text.go @@ -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 {