mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-05 02:41:34 +00:00
fix: artifact preview closes right after opening when a filter writes the reply (#31652)
Since 0.11.1, when a filter function wrote part of the reply before the model answered (for example some text and an HTML block), the artifact preview opened and then closed straight away. The page showed the filter text but was never sent it as part of the reply, so the model's first output overwrote it, the page briefly saw no HTML block and closed the preview. The filter text is now sent to the page before the model's output, so the preview stays open. Fixes #31643
This commit is contained in:
parent
f453324997
commit
1058444d74
1 changed files with 3 additions and 0 deletions
|
|
@ -4784,6 +4784,9 @@ async def streaming_chat_response_handler(response, ctx):
|
|||
'content': [{'type': 'output_text', 'text': initial_content}],
|
||||
}
|
||||
]
|
||||
if not continuing:
|
||||
# the client needs this item before the first delta arrives
|
||||
await event_emitter({'type': 'chat:completion', 'data': {'output': output}})
|
||||
else:
|
||||
output = []
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue