Open hwk68 opened 1 month ago
Hey @hwacomk68! 👋 I'm here to help you with bug fixes, answer questions, and even guide you on becoming a contributor. Let's squash those bugs together!
The /messages
API endpoint returns an empty retriever_resources[]
array when the citations feature is enabled because it is designed to return a list of chat history messages without including detailed citation data. In contrast, the /chat-messages
endpoint includes the citation data correctly as it is designed to handle the full response of a chat message, including metadata such as retriever_resources
[1][2][3].
If you need the citation data, you should use the /chat-messages
endpoint, which is intended to provide the complete response, including citations.
To continue talking to Dosu, mention @dosu.
I guess that endpoint is missing the reference to those retrieved data.
I have encountered the same issue.
When using the basic orchestration in a chatbot, the knowledge base references can be correctly found in both the streaming chat and the historical records.
However, when switching to chatflow orchestration, they can only be found in the knowledge-retrieval
node of the streaming chat.
I checked the response of the request history interface, and it also returned an empty retriever_resources[]
array.
This means that the knowledge base references are only displayed during the chat session and are lost from the chat history after refreshing the page.
I checked #5927 .
I can found the right retriever_resources
array in response event: message_end
from /chat-messages
.
So any way to get retriever_resources
from chat history?
I guess you can add a PR for this feature. :)
Self Checks
Dify version
0.6.14
Cloud or Self Hosted
Cloud, Self Hosted (Docker)
Steps to reproduce
✔️ Expected Behavior
When using the /messages API endpoint for a chatflow app with the citations feature enabled in the backend, the json response should include relevant citation data in the retriever_resources[] array.
❌ Actual Behavior
When the citations feature is enabled, calling the /messages endpoint for a chatflow app results in an empty retriever_resources[] array in the json response. This issue only occurs with the chatflow(beta) API(Advanced Chat App API); the chatbot API(Chat App API) does not exhibit this problem.
screenshot:
The response from the /chat-messages endpoint:
The response from the /messages endpoint: