Ver código fonte

Merge pull request #7401 from walker-chen2024/main

bugfix - {{CURRENT_WEEKDAY}} is not working
Timothy Jaeryang Baek 5 meses atrás
pai
commit
22b5feb747
1 arquivos alterados com 2 adições e 0 exclusões
  1. 2 0
      backend/open_webui/utils/task.py

+ 2 - 0
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