Compare commits

..

No commits in common. "ca4fca9a16dd6e39e224adc60eae5d4b119afa78" and "a1844bc818c2e15a208da9316dfe44501f4ed1be" have entirely different histories.

1 changed files with 4 additions and 2 deletions

View File

@ -100,7 +100,9 @@ func (r *AiRouterBiz) RouteWithSocket(c *websocket.Conn, req *entitys.ChatSockRe
go func() {
defer func() {
close(done)
if len(chat) > 0 {
}
var his = []*model.AiChatHi{
{
SessionID: session,
@ -131,7 +133,7 @@ func (r *AiRouterBiz) RouteWithSocket(c *websocket.Conn, req *entitys.ChatSockRe
cancel() // 通知主流程退出
return
}
if v.Type == entitys.ResponseText || v.Type == entitys.ResponseStream || v.Type == entitys.ResponseJson {
if v.Type == entitys.ResponseText || v.Type == entitys.ResponseStream {
chat = append(chat, v.Content)
}
@ -406,7 +408,7 @@ func (r *AiRouterBiz) getSessionChatHis(sessionId string) (his []model.AiChatHi,
cond := builder.NewCond()
cond = cond.And(builder.Eq{"session_id": sessionId})
_, err = r.hisImpl.GetListToStruct(&cond, &dataTemp.ReqPageBo{Limit: r.conf.Sys.SessionLen}, &his, "his_id desc")
_, err = r.hisImpl.GetListToStruct(&cond, &dataTemp.ReqPageBo{Limit: r.conf.Sys.SessionLen}, &his, "his_id asc")
return
}