aayushxrj / aayushxrj/Pluto.ai
cl.Message() update() not working aysnchronously
- Dominant language
- Python
- Stars
- 5
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
I'm facing an issue where the `cl.Message().update()` method is not updating the message content asynchronously as expected in my file processing application.
Here's the relevant part of my code:
```
@cl.on_chat_start
async def start():
# ...
msg = cl.Message(content=f"Processing `{file.name}`...", disable_feedback=True)
await msg.send()
# Process the file and split into chunks
chunks = split_into_chunks(file)
msg.content = f"Creating chunks for `{file.name}`..."
await msg.update()
# Store the data in form of embeddings
vectordb = store_embeddings(chunks)
msg.content = f"Creating embeddings for `{file.name}`. . ."
await msg.update()
# ...
msg.content = f"`{file.name}` processed. You can now ask questions!"
await msg.update()
```
Contributor guide
No contributing guide indexed for this repository
Research direction
The issue is in the Chainlit framework's message handling. Start by examining the `cl.Message` class in the project's dependencies or source code, focusing on the `update()` method's asynchronous behavior. Look for any event loop or threading constraints. Check if there are existing tests for message updates in the test suite. 'Done' means the message content updates visibly and promptly after each await in the provided flow.
Written by the indexing model from the issue text.
Assessment
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100