From 4b536b52836115aa7e917aad110745899c4cecba Mon Sep 17 00:00:00 2001 From: "Walker.Chen" Date: Wed, 27 Nov 2024 08:53:45 +0800 Subject: [PATCH] bugfix - {{CURRENT_WEEKDAY}} is not working Signed-off-by: Walker.Chen https://uniwillai.net --- backend/open_webui/utils/task.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/open_webui/utils/task.py b/backend/open_webui/utils/task.py index b6d0d3bce..a7c767de0 100644 --- a/backend/open_webui/utils/task.py +++ b/backend/open_webui/utils/task.py @@ -25,12 +25,14 @@ def prompt_template( # Format the date to YYYY-MM-DD formatted_date = current_date.strftime("%Y-%m-%d") formatted_time = current_date.strftime("%I:%M:%S %p") + formatted_weekday = current_date.strftime("%A") # EX¡GMonday template = template.replace("{{CURRENT_DATE}}", formatted_date) template = template.replace("{{CURRENT_TIME}}", formatted_time) template = template.replace( "{{CURRENT_DATETIME}}", f"{formatted_date} {formatted_time}" ) + template = template.replace("{{CURRENT_WEEKDAY}}", formatted_weekday) if user_name: # Replace {{USER_NAME}} in the template with the user's name