mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[GH-ISSUE #7216] User location not being sent in chat messages #14662
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 @ProjectMoon on GitHub (Nov 22, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/7216
Bug Report
Installation Method
Docker
Environment
Open WebUI Version: 0.4.3
Ollama (if applicable): 0.4.3
Operating System: Gentoo Linux
Browser (if applicable): Firefox
Confirmation:
Expected Behavior:
When allow user location is enabled, the user's location gets sent with each chat message, assuming the model is requesting access to location via its system prompt.
Actual Behavior:
The location is not sent. The model can use whatever location is cached when the setting was toggled, but otherwise, it is not sent.
Description
Bug Summary:
I have narrowed this down to how the web UI decides whether or not to send location. It seems to send it (and all the other templating variables) when there's a system prompt with the variables in it. Specifically Chat.svelte around line 1093:
When one of these conditions trigger, the web UI will template the prompt, and that also means getting user location.
I CAN get the Web UI to send user location with every message by changing the chat control's system prompt directly. If I put
User's location is {{USER_LOCATION}}in the chat controls system prompt, behavior works as expected.This leads me to believe that Chat.svelte doesn't have access to the model's system prompt as defined in OpenWebUI, for some reason.
Reproduction Details
Steps to Reproduce:
{{USER_LOCATION}}in the system prompt.Be careful not to confuse the cached location with acquiring a new location (
getAndUpdateUserLocation).To clarify further:
{{USER_LOCATION}}, and allow user location is on in user's settings: The current location (i.e. a call tonavigator.geoLocation) is not sent with each chat message.{{USER_LOCATION}}and allow user location is on in user's settings: Current location is sent with every chat message (expected behavior).@tjbck commented on GitHub (Dec 1, 2024):
Intended behaviour here, the user would have to explicitly grant permission for the system to have access to their location. With that being said, if there's a workaround for this, would consider accepting a PR!