chainlit
chainlit copied to clipboard
Chainlit data layer doesn't handle `createdAt` very well
trafficstars
Describe the bug
Unable to update Stepdict in the database. The issue seems to be here, where datetime.isoformat() does not include a Z suffix. However, here, the system attempts to parse it using ISO_FORMAT, which expects the format "%Y-%m-%dT%H:%M:%S.%fZ".
To Reproduce Steps to reproduce the behavior:
- Enable the default Chainlit data layer and define on_chat_resume to allow message editing within a thread.
- Start the server, create a thread, and chat through multiple rounds.
- Restart the server (this step is crucial).
- Locate the previous chat thread and edit one of the queries. This triggers an error in the terminal, but the UI still generates a new response.
- Refresh the page—the new response fails to save.
Expected behavior The following messages should be deleted, and the new response should be correctly displayed and saved in the database.
Screenshots