-
Notifications
You must be signed in to change notification settings - Fork 513
Description
In the documentation, there is the explanation for the use of events inside tools: https://docs.openwebui.com/features/plugin/development/events/. It is not clear (to me) if this is also possible with tools implemented with an OpenAPI service. I suggest that this should be possible, but I am not sure how - there is no clear documentation on this. Nevertheless, there are some hints in the documentation:
- https://docs.openwebui.com/features/mcp says "Choose MCP (Streamable HTTP) if you need: ... Streamed tool events over HTTP with emerging ecosystem support." => Streamed tool events are supported with MCP.
- The documentation says the recommended way to offer a tool from a MCP service to OpenWebUI is with mcpo. There is written "To use an SSE-compatible MCP server, simply specify the server type and endpoint" => thus, it should be clearly possible to offer MCP SSE functionality with mcpo
In the case mcpo can offer SSE support, and due to the fact that mcpo creates an OpenAPI compatible server, this means that there must be SSE support for OpenAPI services. 1. gives the hint that MCP supports tool events.
Thus, I implemented a REST service with a "Content-Type:text/event-stream" response. I asked ChatGpt due to the lack of further documentation on this point and it says that now I can return events inside the stream, with the format
event: type
data: {some json}
as specified in the OpenWebUI documentation here. I know of course that this can be a hallucination, and it didn't work either.
I am currently totally confused if events with OpenApi tools are possible or not, but it is clear to me that the documentation leads me to this assumption. So there is at least a lack in
- the event documentation, which should make it clear that events are possible with native/python implemented tools only (if this is the case) OR
- the OpenAPI tool server documentation, how to implement events with the according REST interface AND/OR
- the MCP documentation, how to implement events (which then can be offered via mcpo over OpenAPI/REST
This pull request initiated from this discussion talks about the possibility to use SeverSentEvents (SSE) from a backend. This is not from the documentation, but it is a further hint that events over SSE could be sent possibly from a tool OpenApi server also.
(If there is at the end no support for events with remote tools, I will create an according feature request as follow-up to this documentation issue)