mirror of
https://github.com/open-webui/open-webui
synced 2025-01-30 22:39:03 +00:00
bugfix - {{CURRENT_WEEKDAY}} is not working
Signed-off-by: Walker.Chen <walker_chen@moremote.com> https://uniwillai.net
This commit is contained in:
parent
4831c9e57e
commit
4b536b5283
@ -25,12 +25,14 @@ def prompt_template(
|
|||||||
# Format the date to YYYY-MM-DD
|
# Format the date to YYYY-MM-DD
|
||||||
formatted_date = current_date.strftime("%Y-%m-%d")
|
formatted_date = current_date.strftime("%Y-%m-%d")
|
||||||
formatted_time = current_date.strftime("%I:%M:%S %p")
|
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_DATE}}", formatted_date)
|
||||||
template = template.replace("{{CURRENT_TIME}}", formatted_time)
|
template = template.replace("{{CURRENT_TIME}}", formatted_time)
|
||||||
template = template.replace(
|
template = template.replace(
|
||||||
"{{CURRENT_DATETIME}}", f"{formatted_date} {formatted_time}"
|
"{{CURRENT_DATETIME}}", f"{formatted_date} {formatted_time}"
|
||||||
)
|
)
|
||||||
|
template = template.replace("{{CURRENT_WEEKDAY}}", formatted_weekday)
|
||||||
|
|
||||||
if user_name:
|
if user_name:
|
||||||
# Replace {{USER_NAME}} in the template with the user's name
|
# Replace {{USER_NAME}} in the template with the user's name
|
||||||
|
Loading…
Reference in New Issue
Block a user