From 569751f5dbd9254717c592b8d098802280030a77 Mon Sep 17 00:00:00 2001 From: "1808837298@qq.com" <1808837298@qq.com> Date: Fri, 23 Feb 2024 17:40:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E6=B8=A0=E9=81=93=E6=8C=87=E5=AE=9A=E6=A8=A1=E5=9E=8B=E6=97=B6?= =?UTF-8?q?=E5=AE=9E=E9=99=85=E4=BD=BF=E7=94=A8gpt-3.5-turbo=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20(close=20#67)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controller/channel-test.go | 3 ++- web/src/components/ChannelsTable.js | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/controller/channel-test.go b/controller/channel-test.go index 3c3e94b..3afd4b8 100644 --- a/controller/channel-test.go +++ b/controller/channel-test.go @@ -16,6 +16,7 @@ import ( ) func testChannel(channel *model.Channel, request ChatRequest) (err error, openaiErr *OpenAIError) { + common.SysLog(fmt.Sprintf("testing channel %d with model %s", channel.Id, request.Model)) switch channel.Type { case common.ChannelTypePaLM: fallthrough @@ -113,7 +114,7 @@ func TestChannel(c *gin.Context) { }) return } - testModel := c.Param("model") + testModel := c.Query("model") channel, err := model.GetChannelById(id, true) if err != nil { c.JSON(http.StatusOK, gin.H{ diff --git a/web/src/components/ChannelsTable.js b/web/src/components/ChannelsTable.js index 3fcd502..9fdd597 100644 --- a/web/src/components/ChannelsTable.js +++ b/web/src/components/ChannelsTable.js @@ -463,11 +463,8 @@ const ChannelsTable = () => { const res = await API.get(`/api/channel/test/${record.id}?model=${model}`); const {success, message, time} = res.data; if (success) { - let newChannels = [...channels]; record.response_time = time * 1000; record.test_time = Date.now() / 1000; - - setChannelFormat(newChannels) showInfo(`通道 ${record.name} 测试成功,耗时 ${time.toFixed(2)} 秒。`); } else { showError(message);