mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-23 18:25:10 -05:00
Allow pipe functions to return AsyncGenerator #1586
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 @RobinBially on GitHub (Jul 23, 2024).
Is your feature request related to a problem? Please describe.
Currently, a function blocks the event loop if it is called synchronously, but if we call it asynchronously, we need to return a starlette StreamingResponse, which complicates the code.
Describe the solution you'd like
Just add this code to apps/webui/main.py, line 400:
and
in line 449 (non streaming case)
Additionally, we should be able to run a non-coroutine pipe function in a separate thread.
@justinh-rahb commented on GitHub (Jul 23, 2024):
PR welcomed 👍
@tjbck commented on GitHub (Jul 24, 2024):
Added to dev!