mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[function] Unable to emit message envents asynchronously when emitting citations events first
#3777
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @sticky-note on GitHub (Feb 12, 2025).
Installation Method
Docker Compose default install with ollama-cuda
Environment
Open WebUI Version:
v0.5.10Ollama (if applicable): Not relevant
Operating System: Arch + docker
Browser (if applicable): Tested on latest Chrome and Firefox
Confirmation:
Expected Behavior:
Be able to emit message AND citation in any order asynchrounously from a pipe function ( manifold )
Actual Behavior:
Hello
OpenWebUIteam, I'm encountering difficulties to get the display ofcitationsand streaming response when I'm emitting citations from anasync for:Here an example code:
Description
Bug Summary:
async for chunk in stream_reponse(but the data I want to display as citation is not yet pulled from the 3rd-party source.citationsevents occur after the response streaming but the WebUI cannot link between response content citations and citations emittedIn this case, I can see the network reply in web console displays the correct payload (I suppose) but I get a bunch of errors on each message chat event (I suppose) on the Console. See attached pictures.
The problems seems to occur when the first citation is emitted in the
async forloop, all the subsequent messages event seems to be misinterpreted by the frontend.Btw, I can see in backend logs it is correctly yielding the completions from 3rd-party source.
If anyone can shed some light on this for me, I'll be grateful?
Reproduction Details
Steps to Reproduce:
Logs and Screenshots
Browser Console Logs:
Docker Container Logs:
Not really relevant but I can Upload if asked
Screenshots/Screen Recordings (if applicable):
Additional Information
I can reproduce on my side and upload more info if not reproducible on your side
I have separated
stream_response()for readability but I have tested also inside theasync forinside the mainpipe()function with same results.Note
Let me know if further information are required to address this bug or if I simply don't get it right
@rgaricano commented on GitHub (Feb 12, 2025):
I'm not sure but it seems to me that the type of the emitter should be "function" and name "citation