mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 02:48:13 -05:00
Feature Request: Pass Through Additional Metadata (id, chat_id, session_id) to Custom Backend
#2669
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 @GregorBiswanger on GitHub (Nov 18, 2024).
Important Notes
As a .NET developer and enthusiastic user of Open WebUI, I’ve developed a NuGet package, OllamaApiFacade, that allows .NET developers to integrate Open WebUI as a ready-to-use frontend UI while implementing their own backend logic in C#. I also plan to create a similar package for Node.js, enabling developers to focus on building AI solutions without worrying about frontend or communication logic.
Open WebUI already provides excellent features for communicating with backends like Ollama or OpenAI. However, these backends are stateless, and adding the ability to pass metadata such as
id,chat_id, andsession_idthrough to custom backends would simplify state management and enhance the developer experience.Is your feature request related to a problem? Please describe.
Currently, when Open WebUI forwards requests to custom backends, critical metadata such as
id,chat_id, andsession_idis not included. For developers building stateful backend logic, the absence of this information makes it difficult to maintain user or session context.As a fan of Open WebUI, I find it challenging to handle state management in my backend effectively without these fields. This makes the development process more complex and detracts from focusing on core AI logic.
Describe the solution you'd like
I propose that Open WebUI includes an option or standard behavior to forward additional metadata (
id,chat_id,session_id) when sending requests to custom backends. This would allow developers to:This feature would make Open WebUI even more developer-friendly and powerful for integrating custom backends.
Describe alternatives you've considered
Manual Injection of
session_idorchat_id: I have attempted to explore workarounds to manually inject these fields into requests or simulate them. However, without native support from Open WebUI, this approach is infeasible, as it is almost impossible to reliably identify and process requests.Custom Pipelines: While Open WebUI allows building custom pipelines, this approach feels overly complex for someone without Python experience. It would require significant effort to implement a pipeline just to pass these fields. A built-in solution would greatly simplify the process and make it accessible to a broader audience.
In summary, I have not found any viable alternative that would allow me to handle identifiable requests or manage state efficiently.
Additional context
I am a big fan of Open WebUI and deeply impressed by its capabilities and flexibility. Adding support for metadata pass-through would align with its vision of empowering developers to create innovative AI solutions. This feature would make Open WebUI even more valuable for developers across different platforms, whether in .NET, Node.js, or others.
Thank you for considering this request! I would be happy to contribute to further discussions or testing this feature.