mirror of
https://github.com/open-webui/open-webui.git
synced 2026-03-14 11:05:45 -05:00
Allow proxy ping requests, don't crash if not parseable #149
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 @denlogv on GitHub (Jan 4, 2024).
Is your feature request related to a problem? Please describe.
I am trying to use Ollama-WebUI for a custom Langchain pipeline, but am having problems conforming with what the JS backend expects as a response, as it appears very strict about it. I implemented a "proxy" server (FastAPI) that has a generic router for all paths and methods and adds some custom logic to
/api_tagsand/api/generateendpoints. To simulate responses from Ollama, I use EventSourceResponses of the following form:It works well when just routing responses from Ollama, but when using a pipeline, this server sometimes sends other events such as ping messages, which Ollama WebUI backend doesn't handle, as it tries to parse them as if they were "normal" responses from Ollama, which causes the backend to break from the IO loop:
Describe the solution you'd like
Could you maybe just ignore such responses instead of breaking from the loop? I am not sure how to add some sort of middleware for events that would filter out everything that doesn't look like Ollama responses. Or maybe you have an idea of how to do that?
PS
Also, what it is the recommended way to debug this application?
@tjbck commented on GitHub (Jan 5, 2024):
Hi, Thanks for the suggestion! We won't be modifying the frontend code as we can't be 100% sure if there would not be any side effects, but maybe the community can help you out with your backend code. I'll move this post to discussion, Thanks!