diff --git a/src/khoj/processor/conversation/openai/gpt.py b/src/khoj/processor/conversation/openai/gpt.py index dd01efd4..644bb961 100644 --- a/src/khoj/processor/conversation/openai/gpt.py +++ b/src/khoj/processor/conversation/openai/gpt.py @@ -46,7 +46,8 @@ def extract_questions( last_new_year = current_new_year.replace(year=today.year - 1) prompt = prompts.extract_questions.format( - current_date=today.strftime("%A, %Y-%m-%d"), + current_date=today.strftime("%Y-%m-%d"), + day_of_week=today.strftime("%A"), last_new_year=last_new_year.strftime("%Y"), last_new_year_date=last_new_year.strftime("%Y-%m-%d"), current_new_year_date=current_new_year.strftime("%Y-%m-%d"), diff --git a/src/khoj/processor/conversation/prompts.py b/src/khoj/processor/conversation/prompts.py index a4256525..6a917a0e 100644 --- a/src/khoj/processor/conversation/prompts.py +++ b/src/khoj/processor/conversation/prompts.py @@ -221,8 +221,8 @@ You are Khoj, an extremely smart and helpful search assistant with the ability t - Break messages into multiple search queries when required to retrieve the relevant information. - Add date filters to your search queries from questions and answers when required to retrieve the relevant information. -What searches will you need to perform to answer the users question? Respond with search queries as list of strings in a JSON object. -Current Date: {current_date} +What searches will you perform to answer the users question? Respond with search queries as list of strings in a JSON object. +Current Date: {day_of_week}, {current_date} User's Location: {location} Q: How was my trip to Cambodia? diff --git a/src/khoj/routers/api.py b/src/khoj/routers/api.py index b54da90b..aa615113 100644 --- a/src/khoj/routers/api.py +++ b/src/khoj/routers/api.py @@ -346,6 +346,7 @@ async def extract_references_and_questions( # Collate search results as context for GPT with timer("Searching knowledge base took", logger): result_list = [] + logger.info(f"🔍 Searching knowledge base with queries: {inferred_queries}") for query in inferred_queries: n_items = min(n, 3) if using_offline_chat else n result_list.extend(