feat: system prompt variables (e.g. username, current datetime) #954

Closed
opened 2025-11-11 14:34:20 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @spoutop on GitHub (May 17, 2024).

Is your feature request related to a problem? Please describe.
It would be nice if the model could personalize responses based on the current user's username. It would be more engaging and user-friendly if the model could address users by their names used when registering.

Describe the solution you'd like
I would like to pass the current username to the model's context window before sending the query so that the model can respond back with "Hi username." This would require modifying the backend to include the username in the context.

Describe alternatives you've considered
An alternative solution could be to create a middleware that intercepts the queries, inserts the username, and then forwards it to the model. Another option is to have the frontend handle username insertion before sending queries. A toggle option under Settings > Interface would be nice.

Additional context
Consideration to add more user data in the future would be nice like Age, Gender, etc for personalize responses.

Originally created by @spoutop on GitHub (May 17, 2024). **Is your feature request related to a problem? Please describe.** It would be nice if the model could personalize responses based on the current user's username. It would be more engaging and user-friendly if the model could address users by their names used when registering. **Describe the solution you'd like** I would like to pass the current username to the model's context window before sending the query so that the model can respond back with "Hi username." This would require modifying the backend to include the username in the context. **Describe alternatives you've considered** An alternative solution could be to create a middleware that intercepts the queries, inserts the username, and then forwards it to the model. Another option is to have the frontend handle username insertion before sending queries. A toggle option under Settings > Interface would be nice. **Additional context** Consideration to add more user data in the future would be nice like Age, Gender, etc for personalize responses.
Author
Owner

@tjbck commented on GitHub (May 31, 2024):

image

image

image

Added to latest dev, let me know if you encounter any issues!

@tjbck commented on GitHub (May 31, 2024): ![image](https://github.com/open-webui/open-webui/assets/25473318/cfb06360-62cf-4055-a221-e38f36158d06) ![image](https://github.com/open-webui/open-webui/assets/25473318/d1b5cbe9-3a97-4b89-951c-9f38cb1d4fc2) ![image](https://github.com/open-webui/open-webui/assets/25473318/c2948055-658f-4c29-9786-88ac3f29affb) Added to latest dev, let me know if you encounter any issues!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#954