mirror of
https://github.com/open-webui/open-webui.git
synced 2026-03-11 00:04:08 -05:00
feat: Add {{CURRENT_DATETIME}} variable support in Tool Prompts #4811
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 @loong95 on GitHub (Apr 11, 2025).
Check Existing Issues
Problem Description
Hello Open WebUI team,
I'm currently working on implementing time-sensitive tools (like weather queries) and noticed a limitation in the tool calling system. While
{{CURRENT_DATETIME}}works well in system prompts, this functionality isn't available in tool-specific prompts.Current Challenge:
When implementing a tool like:
I want to handle queries like "What was yesterday's weather?" by referencing the current date in the tool prompt. However, since tool prompts don't support the
{{CURRENT_DATETIME}}variable, I'm unable to:Calculate relative dates (yesterday/tomorrow)
Provide time-aware responses
Maintain consistency with system prompt timestamps
This creates a disconnect between what the LLM understands (via system prompt) and what tools can access.
Desired Solution you'd like
Could we extend
{{CURRENT_DATETIME}}support to tool calling prompts? This would enable proper time-awareness throughout the entire processing pipeline.Alternatives Considered
No response
Additional Context
No response
@tjbck commented on GitHub (Apr 11, 2025):
You should use the python built-in functions.