ragflow icon indicating copy to clipboard operation
ragflow copied to clipboard

[Question]: RAG-Graph Generate-Answer with history message in chat api

Open SG-XM opened this issue 1 year ago • 7 comments

Describe your problem

"I have a very complex graph model, and in one of the processes, I connect an answer generation component with a human-computer interaction component. In this stage, I need to continuously ask the user questions, and each conversation requires the complete history of the dialogue to ensure that the next question does not repeat previous ones. Therefore, I want to know how many past conversations are appended with each API call? And whether any summarization is performed? Additionally, how can I append historical information? My prompt works fine with GPT-4o and can complete multi-turn questioning as required. However, in the ragglow-graph, after several rounds of dialogue, it starts asking repetitive questions. I am also using the GPT-4o model, but I cannot see the detailed OpenAPI POST body, so I cannot determine where the problem is."

SG-XM avatar Jul 11 '24 15:07 SG-XM

Could you paste the picture of canvas here?

KevinHuSh avatar Jul 12 '24 01:07 KevinHuSh

image here is my canvas,in this loop gpt-4o where ask about 21 questions,but after 10+ conversation,model begin to repeat previous question,but with the same prompt in chat.openai.com,gpt-4o, it works well.

SG-XM avatar Jul 12 '24 03:07 SG-XM

image I use this "history" param to append history message,but in fact this editabe text is prompt rather than previous conversation list.

SG-XM avatar Jul 12 '24 03:07 SG-XM

image I use this "history" param to append history message,but in fact this editabe text is prompt rather than previous conversation list.

It's useless to add history parameter. "回答时请考虑聊天历史" that's enough.

This is about enlarge hisotry window size. We will fixed it later.|

It's meaningless to add ’message‘(人机交互) after ’begin‘ since 'begin' has already include one piece of message.

KevinHuSh avatar Jul 12 '24 07:07 KevinHuSh

thanks,i have added "回答时请考虑聊天历史" . Could you please add a 'number of previous messages included' setting, similar to other GPT conversation tools (e.g., NextChat)?

It's useless to add history parameter. "回答时请考虑聊天历史" that's enough. This is about enlarge hisotry window size. We will fixed it later.|

SG-XM avatar Jul 12 '24 07:07 SG-XM

its still has problem after 12 times conversations,i have set max window size to 64,but it looks like still 12. My conversation has repeated after 12.

SG-XM avatar Jul 12 '24 10:07 SG-XM

@KevinHuSh,excuse, in your commit,it seems just update UI design rather than really request body?

SG-XM avatar Jul 12 '24 12:07 SG-XM