From a39e747d07b72880048de7af0f08f449f8e6fc5e Mon Sep 17 00:00:00 2001 From: Debanjum Date: Mon, 28 Oct 2024 20:29:47 -0700 Subject: [PATCH] Improve passing user name in pick next research tool prompt --- src/khoj/processor/conversation/prompts.py | 2 +- src/khoj/routers/research.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/khoj/processor/conversation/prompts.py b/src/khoj/processor/conversation/prompts.py index b075e8de..cfa39aa2 100644 --- a/src/khoj/processor/conversation/prompts.py +++ b/src/khoj/processor/conversation/prompts.py @@ -663,7 +663,7 @@ Assuming you can search my notes and the internet. # Background Context - Current Date: {day_of_week}, {current_date} - My Location: {location} -- My {username} +- My Name: {username} # Available Tool AIs Which of the tool AIs listed below would you use to answer my question? You **only** have access to the following tool AIs: diff --git a/src/khoj/routers/research.py b/src/khoj/routers/research.py index ca5963e3..3ca0839b 100644 --- a/src/khoj/routers/research.py +++ b/src/khoj/routers/research.py @@ -74,7 +74,6 @@ async def apick_next_tool( # Extract Past User Message and Inferred Questions from Conversation Log today = datetime.today() location_data = f"{location}" if location else "Unknown" - username = prompts.user_name.format(name=user_name) if user_name else "" function_planning_prompt = prompts.plan_function_execution.format( tools=tool_options_str, @@ -82,7 +81,7 @@ async def apick_next_tool( personality_context=personality_context, current_date=today.strftime("%Y-%m-%d"), day_of_week=today.strftime("%A"), - username=username, + username=user_name or "Unknown", location=location_data, previous_iterations=previous_iterations_history, max_iterations=max_iterations,