Get empty retriever_resources parameter in API with /messages method
Self Checks
- [x] This is only for bug report, if you would like to ask a question, please head to Discussions.
- [x] I have searched for existing issues search for existing issues, including closed ones.
- [x] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
- [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
- [x] Please do not modify this template :) and fill in all the required fields.
Dify version
v1.0.0
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
In webpage there are retrieved resources:
In API and only with /messages method the list is empty, it works well with /chat-message method:
{
"limit": 20,
"has_more": false,
"data": [
{
"id": "a87431be-ab19-4bb2-bc14-8e4d07bb489c",
"conversation_id": "65e69008-a4d2-48f8-8d37-ee02c7cf46ec",
"parent_message_id": "00000000-0000-0000-0000-000000000000",
"inputs": {},
"query": "什么是勾股定理",
"answer": "勾股定理是一个基本的几何定理,它描述了直角三角形中三边之间的关系。具体来说,勾股定理指出:**在直角三角形中,两条直角边的平方和等于斜边的平方**。\n\n用数学公式表示就是: \n$$\na^2 + b^2 = c^2\n$$\n其中,$a$ 和 $b$ 是直角三角形的两条直角边,$c$ 是斜边(即直角三角形中与直角相对的最长边)。\n\n---\n\n### **勾股定理的来源**\n在中国古代,直角三角形被称为“勾股形”,其中较短的直角边称为“勾”,较长的直角边称为“股”,斜边称为“弦”。因此,这个定理在中国也被称为“勾股定理”或“商高定理”。\n\n---\n\n### **勾股定理的几何意义**\n勾股定理揭示了直角三角形中三边之间的数量关系。它不仅是一个数学公式",
"message_files": [],
"feedback": null,
"retriever_resources": [], //null
"created_at": 1740830044,
"agent_thoughts": [],
"status": "normal",
"error": null
}
]
}
✔️ Expected Behavior
Get a list of retrievered resources.
❌ Actual Behavior
Get empty list.
I found a similar unsolved discussion regarding the issue of the API returning an empty retriever_resources parameter when using the /messages method [1]. Additionally, there is an open issue suggesting a solution:
- Configuration Check: Ensure that the
show_retrieve_sourcefeature is enabled in your application's configuration. This feature controls whetherretriever_resourcesare included in the response. If it's not enabled, theretriever_resourceswill not be included. This configuration is found in theapp_config.additional_featuresof theapplication_generate_entityand is managed by theRetrievalResourceConfigManagerclass. You may need to check the configuration files or the backend code to ensure that theretriever_resourceis enabled [2].
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other
I can't find a solution in similar issues. Please don't close it with duplicated.
The same problem occurs in web app @crazywoola :
New chat:
Switch to other tab and switch back:
The same problem occurs in web app @crazywoola : New chat:
Switch to other tab and switch back:
The bug also occurs on dify cloud
Will take a look at it later.
Any updates?@crazywoola
The same bug I meet, which version will be resolved ? Thanks. @crazywoola
Haven't got time to fix this yet.
It's a fatal question.
I submitted a PR #17304
I have the same problem
I also met the same question that the 'retriever_resources' is null. And the feature control is enable
{ 'event': 'message', 'task_id': '15a26101-dae6-47d2-b8ac-d839070a1b79', 'id': '71fa8f8b-7246-47bc-bc34-17d484539ff8', 'message_id': '71fa8f8b-7246-47bc-bc34-17d484539ff8', 'conversation_id': '2a720c0c-ce66-48a7-8c8c-83ce17d69d6e', 'mode': 'advanced-chat', 'answer': "\n", 'metadata': { 'annotation_reply': None, 'retriever_resources': [], //null 'usage': {...} }, 'created_at': 1756712258 }