https://github.com/rollecode/open-webui-time-awareness
https://github.com/rollecode/open-webui-time-awareness
Last synced: 27 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/rollecode/open-webui-time-awareness
- Owner: rollecode
- Created: 2025-07-16T17:13:01.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2025-07-24T14:48:37.000Z (10 months ago)
- Last Synced: 2026-05-02T13:33:31.505Z (28 days ago)
- Language: Python
- Size: 16.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
## 🕙 Open WebUI Time Awareness function
### An [Open WebUI](https://github.com/open-webui/open-webui) filter that automatically adds time context to user messages, enabling AI assistants to be aware of the current time and date in conversations.

 
## ✨ Features
- **Automatic time injection**: Seamlessly adds current time context to user messages
- **Timezone awareness**: Supports user-specific and system timezone configuration
- **Image generation friendly**: Automatically detects and skips image generation requests
- **Multimodal support**: Handles text and image content properly
- **ComfyUI integration**: Supports ComfyUI workflow detection
- **User customization**: Configurable through user valves
- **Privacy-focused**: No external API calls, all processing happens locally
## 🧠 How it works
The filter automatically injects time context into user messages, allowing AI assistants to:
- Understand when messages are sent
- Provide time-relevant responses
- Format dates and times appropriately
- Consider context like "today", "yesterday", "this week", etc.
## 📦 Installation
1. Add `time-awareness.py` to your Open WebUI Functions
2. Ensure dependencies are installed:
```bash
pip install beautifulsoup4 lxml
```
## ⚙️ Configuration
### System Valves
- **Timezone**: Default system timezone (e.g., "UTC", "Europe/Helsinki")
- **Priority**: Filter execution priority (default: -10)
### User Valves
- **Timezone**: Personal timezone override
- **Enabled**: Toggle to enable/disable the filter per user
- **Disable for Image Generation**: Skip time injection for image generation requests (default: true)
## 🔧 Dependencies
- `beautifulsoup4` - For parsing HTML/XML content
- `lxml` - XML parser for BeautifulSoup (install with `pip install lxml`)
## 📝 Example
When a user sends: "What's the weather like today?"
The filter automatically adds time context:
```xml
Filters context
```
## 🐛 Troubleshooting
### Common Issues
1. **BeautifulSoup XML parser error**: Install lxml with `pip install lxml`
2. **Timezone not recognized**: Check timezone is in `zoneinfo.available_timezones()`
3. **Multimodal content error**: Update to latest version with multimodal support
## 📄 License
This project is licensed under the MIT License.
## 🙏 Acknowledgments
Inspired by the need for time-aware AI conversations in Open WebUI.