From 998b07ab8c9fcf1f3890d42ef58481e09d520b6d Mon Sep 17 00:00:00 2001 From: jinghong0202 Date: Sun, 24 Dec 2023 08:36:34 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20Azure=20Api=20=E6=9B=B4=E6=8D=A2api-vers?= =?UTF-8?q?ion=E5=8F=82=E6=95=B0=E5=90=8E=E8=AF=B7=E6=B1=82=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/handler/chatimpl/azure_handler.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api/handler/chatimpl/azure_handler.go b/api/handler/chatimpl/azure_handler.go index 489ce012..273d5317 100644 --- a/api/handler/chatimpl/azure_handler.go +++ b/api/handler/chatimpl/azure_handler.go @@ -69,13 +69,15 @@ func (h *ChatHandler) sendAzureMessage( var responseBody = types.ApiResponse{} err = json.Unmarshal([]byte(line[6:]), &responseBody) - if err != nil || len(responseBody.Choices) == 0 { // 数据解析出错 + if err != nil { // 数据解析出错 logger.Error(err, line) utils.ReplyMessage(ws, ErrorMsg) utils.ReplyMessage(ws, ErrImg) break } - + if len(responseBody.Choices) == 0 { + continue; + } fun := responseBody.Choices[0].Delta.FunctionCall if functionCall && fun.Name == "" { arguments = append(arguments, fun.Arguments)