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)