From a721a5b6f9d4a9ce721ce323c5eeb0be34a3b97b Mon Sep 17 00:00:00 2001 From: JustSong Date: Sun, 3 Sep 2023 21:46:07 +0800 Subject: [PATCH] chore: add error prompt for Azure --- controller/channel-test.go | 7 ++++++- i18n/en.json | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/controller/channel-test.go b/controller/channel-test.go index 686521eff6..8c7e6f0d8e 100644 --- a/controller/channel-test.go +++ b/controller/channel-test.go @@ -14,7 +14,7 @@ import ( "time" ) -func testChannel(channel *model.Channel, request ChatRequest) (error, *OpenAIError) { +func testChannel(channel *model.Channel, request ChatRequest) (err error, openaiErr *OpenAIError) { switch channel.Type { case common.ChannelTypePaLM: fallthrough @@ -32,6 +32,11 @@ func testChannel(channel *model.Channel, request ChatRequest) (error, *OpenAIErr return errors.New("该渠道类型当前版本不支持测试,请手动测试"), nil case common.ChannelTypeAzure: request.Model = "gpt-35-turbo" + defer func() { + if err != nil { + err = errors.New("请确保已在 Azure 上创建了 gpt-35-turbo 模型,并且 apiVersion 已正确填写!") + } + }() default: request.Model = "gpt-3.5-turbo" } diff --git a/i18n/en.json b/i18n/en.json index aed659792f..9b2ca4c8a6 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -523,5 +523,6 @@ "按照如下格式输入:": "Enter in the following format:", "模型版本": "Model version", "请输入星火大模型版本,注意是接口地址中的版本号,例如:v2.1": "Please enter the version of the Starfire model, note that it is the version number in the interface address, for example: v2.1", - "点击查看": "click to view" + "点击查看": "click to view", + "请确保已在 Azure 上创建了 gpt-35-turbo 模型,并且 apiVersion 已正确填写!": "Please make sure that the gpt-35-turbo model has been created on Azure, and the apiVersion has been filled in correctly!" }