|
@@ -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).
|