Browse Source

修复dify返回ping的问题

boweniac 3 months ago
parent
commit
0be6d6e49b
1 changed files with 4 additions and 4 deletions
  1. 4 4
      internal/logic/chatrecords/gpts_submit_api_chat_logic.go

+ 4 - 4
internal/logic/chatrecords/gpts_submit_api_chat_logic.go

@@ -184,7 +184,7 @@ func (l *GptsSubmitApiChatLogic) GptsSubmitApiChat(tokenStr string, req *types.G
 			if err != nil {
 				fmt.Printf("json unmarshall error:%v\n", err)
 				fmt.Printf("line:%v\n", line)
-				break
+				continue
 			}
 
 			answer = answer + chatData.Answer
@@ -219,10 +219,10 @@ func (l *GptsSubmitApiChatLogic) GptsSubmitApiChat(tokenStr string, req *types.G
 					agentId := strconv.Itoa(int(*req.AgentId))
 					// 记录Token使用信息
 					usageDetailItem, err := l.svcCtx.DB.UsageDetail.Create().
-						SetType(3).            //1-微信 2-名片 3-智能体
-						SetBotID(agentId).     //智能体ID
+						SetType(3). //1-微信 2-名片 3-智能体
+						SetBotID(agentId). //智能体ID
 						SetReceiverID(userId). //接收者userID
-						SetApp(8).             //8-智能体
+						SetApp(8). //8-智能体
 						SetSessionID(0).
 						SetRequest(*req.Content).
 						SetResponse(answer).