Skip to content
Discussion options

You must be logged in to vote

I'm struggling to get your example working. I think it needs some cleanup before we can tackle the actual problem. E.g. right now everything is nested under a floating action button, which is pretty strange. And try to remove unnecessary things like the spinner while keeping the things that matter.

In general I would recommend not to create the UI within the response() function. Let it return the data and build the UI after awaiting it:

async def send():
    if text.value:
        messages.append((text.value, True, None))
        chat_messages.refresh()
        message = await run.io_bound(response)
        messages.append((message, False, ui.button('asa')))
        spinner.set_visibility(F…

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
1 reply
@RWallan
Comment options

Comment options

You must be logged in to vote
1 reply
@RWallan
Comment options

Comment options

You must be logged in to vote
4 replies
@RWallan
Comment options

@RWallan
Comment options

@vivekdse
Comment options

@falkoschindler
Comment options

Answer selected by RWallan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants