Replies: 3 comments 1 reply
-
|
https://textual.textualize.io/guide/workers/
|
Beta Was this translation helpful? Give feedback.
-
|
Hi, my llm call uses async streaming. This isn't the problem source. |
Beta Was this translation helpful? Give feedback.
-
|
After hours of unfruitful debug, and make many tries not able to produce MRE. For mock agent, I think the reason I see a ui halt is probably update ui then call bedrock immediately, and ui won't update. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
this is from #6208 (comment),
I have another case, that when I submit in CustomTextArea,
and try to call llm, I have a Messages component above CustomTextArea,
so I need to first append this user's message to it, then call llm
to retrieve llm response to append to Messages again, when hit enter
in textarea, the ui just halts and after llm response will be both messages
append to Messages component. And the loading_indicator (the spinning
component wounldn't show). Any idea on that?
The component structure is like this, REPL has Messages and Input,
Input submit should update Messages(it's parent's components, so ui update
is happening in parent). Is it possible that child workers
will block parent's ui update? I tried first add user message first and then
immedicate call run_worker of calling llm, with no luck. The Messages component
's update_messages has self.mutate_reactive in it, which shouldn't be a problem.
If I return after adding user message and don't do call llm, then Messages immediately
shows user message.
Unfortunately I can't produce a small reproducible example,
if you want I want point you to my open source repository for the example,
and maybe schedule a session on how to set it up.(basically it's a cli agent
like claude code, has input to submit query).
I tried [Anatomy of a Textual User Interface]
example, and changed @work(thread=True) to @work ,and async def send_prompt,
change self.call_from_thread(response.update, response_content) to response.update(response_content),
then it kind of reproduce my bug, the user message and response didn't show up for like 5 seconds,
and then user message and response suddenly shows up.
Shouldn't @work also at least run work in background and should update ui?
Beta Was this translation helpful? Give feedback.
All reactions