Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

message api respond sort #15188

Closed
5 tasks done
marsDes opened this issue Mar 7, 2025 · 3 comments · Fixed by #15231
Closed
5 tasks done

message api respond sort #15188

marsDes opened this issue Mar 7, 2025 · 3 comments · Fixed by #15231
Labels
🐞 bug Something isn't working

Comments

@marsDes
Copy link
Contributor

marsDes commented Mar 7, 2025

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.0.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

send message by chat-messages api

{"inputs":{},"query":"111","conversation_id":"6ff16cac-108a-4f19-b1f7-e6570254fc43","response_mode":"streaming","user":"test","files":[]}
...
{"inputs":{},"query":"222","conversation_id":"6ff16cac-108a-4f19-b1f7-e6570254fc43","response_mode":"streaming","user":"test","files":[]},
{"inputs":{},"query":"333","conversation_id":"6ff16cac-108a-4f19-b1f7-e6570254fc43","response_mode":"streaming","user":"test","files":[]}

then get messages history by api or refresh webapp

✔️ Expected Behavior

retrun respon

{
    "limit": 2,
    "has_more": true,
    "data": [
        {
            "id": "f0429390-573c-42ba-a474-0a12e90b4d03",
            "conversation_id": "6ff16cac-108a-4f19-b1f7-e6570254fc43",
            "parent_message_id": "00000000-0000-0000-0000-000000000000",
            "inputs": {},
            "query": "111",
            "answer": "回复:111",
            "message_files": [],
            "feedback": null,
            "retriever_resources": [],
            "created_at": 1741318726,
            "agent_thoughts": [],
            "status": "normal",
            "error": null
        },
        {
            "id": "b9f17600-2b2f-4a78-ba0f-eb9e75aef0ed",
            "conversation_id": "6ff16cac-108a-4f19-b1f7-e6570254fc43",
            "parent_message_id": "00000000-0000-0000-0000-000000000000",
            "inputs": {},
            "query": "222",
            "answer": "回复:222",
            "message_files": [],
            "feedback": null,
            "retriever_resources": [],
            "created_at": 1741318717,
            "agent_thoughts": [],
            "status": "normal",
            "error": null
        }
    ]
}

Image

❌ Actual Behavior

retrun respon

{
    "limit": 2,
    "has_more": true,
    "data": [
        {
            "id": "f0429390-573c-42ba-a474-0a12e90b4d03",
            "conversation_id": "6ff16cac-108a-4f19-b1f7-e6570254fc43",
            "parent_message_id": "00000000-0000-0000-0000-000000000000",
            "inputs": {},
            "query": "222",
            "answer": "回复:222",
            "message_files": [],
            "feedback": null,
            "retriever_resources": [],
            "created_at": 1741318726,
            "agent_thoughts": [],
            "status": "normal",
            "error": null
        },
        {
            "id": "b9f17600-2b2f-4a78-ba0f-eb9e75aef0ed",
            "conversation_id": "6ff16cac-108a-4f19-b1f7-e6570254fc43",
            "parent_message_id": "00000000-0000-0000-0000-000000000000",
            "inputs": {},
            "query": "111",
            "answer": "回复:111",
            "message_files": [],
            "feedback": null,
            "retriever_resources": [],
            "created_at": 1741318717,
            "agent_thoughts": [],
            "status": "normal",
            "error": null
        }
    ]
}

Image

@dosubot dosubot bot added the 🐞 bug Something isn't working label Mar 7, 2025
Copy link

dosubot bot commented Mar 7, 2025

I found a similar unsolved discussion regarding issues with the chat-messages API: In chat-messages, the dialog "inputs:{} cannot be passed in the second time, which was last updated on March 2, 2025 [1].

Regarding your issue with the message API response sorting, ensure that the sort_type parameter is set correctly in your API requests. The sorting method must remain consistent across all paginated requests. If the initial request was made with a specific sort_type, all subsequent requests must use the same sort_type to avoid unexpected sorting results [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

@marsDes
Copy link
Contributor Author

marsDes commented Mar 7, 2025

Get Conversation History Messages api do not support sort_type param
and vesion 0.15.3 is work normal

@marsDes
Copy link
Contributor Author

marsDes commented Mar 7, 2025

@crazywoola #802
0.15.3是正常的。 1.0.0 异常

@marsDes marsDes mentioned this issue Mar 7, 2025
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant