Pārlūkot izejas kodu

Merge branch 'yhg_241210_dify' into debug

jimmyyem 3 mēneši atpakaļ
vecāks
revīzija
44b0de24d6

+ 2 - 2
internal/logic/chatrecords/gpts_get_api_message_logic.go

@@ -57,14 +57,14 @@ func (l *GptsGetApiMessageLogic) GptsGetApiMessage(req *types.GptMessageReq, tok
 		limit = strconv.Itoa(*req.Limit)
 	}
 
-	user := fmt.Sprintf("%s:%d", userId, *req.AgentId)
+	user := fmt.Sprintf("%s-%d", userId, *req.AgentId)
 	fmt.Printf("user=%v ConversationId=%v firstId=%v, limit=%v\n", user, *req.ConversationId, firstId, limit)
 	response, err := dify.GetChatHistory(user, *req.ConversationId, firstId, limit)
 	if err != nil {
 		return nil, err
 	}
 	fmt.Printf("response=%v\n", response)
-	
+
 	resp.Data.HasMore = response.HasMore
 	for _, v := range response.Data {
 		resp.Data.Data = append(resp.Data.Data, types.Message{

+ 1 - 1
internal/logic/chatrecords/gpts_get_api_session_logic.go

@@ -55,7 +55,7 @@ func (l *GptsGetApiSessionLogic) GptsGetApiSession(req *types.GptsSessionReq, to
 		lastId = *req.LastId
 	}
 
-	user := fmt.Sprintf("%s:%d", userId, *req.AgentId)
+	user := fmt.Sprintf("%s-%d", userId, *req.AgentId)
 	fmt.Printf("user=%v lastId=%v, limit=%v\n", user, lastId, limit)
 	response, err := dify.GetSessionList(user, lastId, limit)
 	if err != nil {

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

@@ -80,7 +80,7 @@ func (l *GptsSubmitApiChatLogic) GptsSubmitApiChat(tokenStr string, req *types.G
 	var chatReq dify.ChatReq
 	chatReq.ResponseMode = "streaming"
 	chatReq.Query = *req.Content
-	chatReq.User = fmt.Sprintf("%s:%d", userId, *req.AgentId)
+	chatReq.User = fmt.Sprintf("%s-%d", userId, *req.AgentId)
 
 	chatReq.ConversationId = *req.ConversationId