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

Loader not working with cl.sleep #100

Open
httplups opened this issue Feb 19, 2024 · 1 comment
Open

Loader not working with cl.sleep #100

httplups opened this issue Feb 19, 2024 · 1 comment

Comments

@httplups
Copy link

I was following the tutorial to display the loader (running) while awaiting for the response, but it is not working.
I just copy the code from the documentation.

import chainlit as cl

@cl.on_chat_start
async def main():
    msg = cl.Message(content="Hello!")
    await msg.send()

    await cl.sleep(2)

    msg.content = "Hello again!"
    await msg.update()

It appears Hello, after a few seconds appears Hello Again, but the loader is not shown

@willydouhard
Copy link
Contributor

It only works while the content is empty.

Replace msg = cl.Message(content="Hello!") with msg = cl.Message(content="").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants