-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Description
In my usecase i want the bot to be aware of the current date and time.
How can i best do this ?
I have added current_date to app.py in /ask and /chat routes like so
# hk add date to context context["current_datetime"] = datetime.now().isoformat() # Add current_datetime to overrides if "overrides" not in context: context["overrides"] = {} context["overrides"]["current_datetime"] = context["current_datetime"]
then i added the overrides to the prompt_mnager in chatreadretrieveread.py like so
' query_messages = self.prompt_manager.render_prompt(
self.query_rewrite_prompt, {"user_query": original_user_query,
"past_messages": messages[:-1],
**overrides, # include all override/context variables, such as current_datetime
}
)'
please advise, this seems very cumbersome?