Events in own OpenAPI tool server #67
Unanswered
reuschling
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I implemented an own tool server with a REST interface, providing an OpenAPI json representation which was pasted into OpenWebUIs admin external tool preferences. (https://docs.openwebui.com/features/plugin/tools/openapi-servers/)
I am able to send and receive messages to/from my tool server by asking for information in the chat window, providing parameter values. I managed it to return html code that is nicely visualized in the chat window also, with "Content-Disposition", "inline" header entry. So far so good.
Now I want to ask the user for additional information, triggered from my tool server. Other things like providing a status message, changing the title, etc would be also nice to have, everything that is offered for tool development by events
(https://docs.openwebui.com/features/plugin/development/events).
I tried several things now, e.g. offering a tool function with "text/event-stream" return value, sending events inside the stream in this format:
After each event, I perform a writer.flush(); (Java code)
My tries just didn't work, OpenWebUI just get the whole message return string with all events when the server closes the returned stream. There is no special interpretation of my 'messages'.
How can I emmit OpenWebUI events with my OpenApi tool server. Is there maybe an http endpoint where I can send events to, together with an according chat window id? Or something else? Any help is highly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions