https://github.com/cooksleep/time-awareness-filter-for-open-webui
This is a powerful Filter designed for Open WebUI to inject precise temporal context into your conversations. It automatically adds timestamps to both historical and current messages, enabling the Large Language Model to understand the timeline of your dialogue and provide more accurate, context-aware responses.
https://github.com/cooksleep/time-awareness-filter-for-open-webui
Last synced: 12 months ago
JSON representation
This is a powerful Filter designed for Open WebUI to inject precise temporal context into your conversations. It automatically adds timestamps to both historical and current messages, enabling the Large Language Model to understand the timeline of your dialogue and provide more accurate, context-aware responses.
- Host: GitHub
- URL: https://github.com/cooksleep/time-awareness-filter-for-open-webui
- Owner: CookSleep
- License: mit
- Created: 2025-06-12T20:13:52.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-12T21:49:56.000Z (about 1 year ago)
- Last Synced: 2025-06-12T21:52:32.445Z (about 1 year ago)
- Language: Python
- Size: 22.5 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# â Time Awareness Filter for Open WebUI
This is a powerful Filter designed for [Open WebUI](https://github.com/open-webui/open-webui) to inject precise temporal context into your conversations. It automatically adds timestamps to both historical and current messages, enabling the Large Language Model to understand the timeline of your dialogue and provide more accurate, context-aware responses.
[](https://github.com/CookSleep)
[]()
[]()
## ⨠Key Features
- **Fully Automatic Time Injection**: Automatically prepends timestamps to all user messages.
- **Zero-Config Auth & Timezone**: Automatically detects the current user's authentication info and timezone, eliminating any manual setup for true multi-user support out of the box.
- **Smart Formatting**:
- Displays the full date (`[YYYY-MM-DD, Weekday, HH:MM:SS]`) at the start of a new day.
- Uses a concise time format (`[HH:MM:SS]`) for subsequent messages within the same day to enhance readability.
- **Robust Compatibility**:
- Supports plain text, text with images, and file-only messages.
- **Resilient Error Handling**: Gracefully skips injection if it fails to fetch chat history, ensuring your conversation is not interrupted.
- **Real-time Toggle**: Easily enable or disable the filter on-the-fly from the Open WebUI interface.
## âī¸ Configuration
After [importing](https://openwebui.com/f/cooksleep/time_awareness) and enabling the Filter (You also need to click "More" and enable "Global" so that it appears in all conversations), click the gear icon to the right of "Time Awareness" under **Admin Panel > Functions** to find the following options:
- **`api_base_url`**:
- **Description**: The base URL of your Open WebUI backend.
- **Default**: `http://127.0.0.1:8080`
- **`date_format`**:
- **Description**: The display format for the date.
- **Default**: `ISO`
- **Options**:
- `"ISO"` (2025-06-13)
- `"DMY_SLASH"` (13/06/2025)
- `"MDY_SLASH"` (06/13/2025)
- `"DMY_DOT"` (13.06.2025)
- **`debug_print_request`**:
- **Description**: Logs detailed debugging information to the **Open WebUI backend logs**, useful for troubleshooting.
- **Default**: `False`
## â ī¸ Important Notes
- This filter requires the `httpx` library. If you have a manual (non-Docker) installation of Open WebUI, ensure it's installed: `pip install httpx`. Docker users don't need to worry, as it's included in the image.
- Please ensure the `api_base_url` is configured correctly so the Filter can reach the Open WebUI API.
## đŦ Feedback & Contributing
If you encounter any issues or have suggestions for improvement, please feel free to [open an issue](https://github.com/CookSleep/Time-Awareness-Filter-for-Open-WebUI/issues) on GitHub.
## đ License
This project is licensed under the MIT License.