From 327fcb8f62ddf98d2a16afac2992695dc331dfa5 Mon Sep 17 00:00:00 2001 From: sabaimran Date: Fri, 1 Nov 2024 16:48:03 -0700 Subject: [PATCH] create defiltered query after conversation command is extracted --- src/khoj/routers/api_chat.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/khoj/routers/api_chat.py b/src/khoj/routers/api_chat.py index 6f44854c..cee238a2 100644 --- a/src/khoj/routers/api_chat.py +++ b/src/khoj/routers/api_chat.py @@ -716,7 +716,6 @@ async def chat( ## Extract Document References compiled_references: List[Any] = [] inferred_queries: List[Any] = [] - defiltered_query = defilter_query(q) if conversation_commands == [ConversationCommand.Default] or is_automated_task: conversation_commands = await aget_relevant_information_sources( @@ -751,6 +750,8 @@ async def chat( await conversation_command_rate_limiter.update_and_check_if_valid(request, cmd) q = q.replace(f"/{cmd.value}", "").strip() + defiltered_query = defilter_query(q) + if conversation_commands == [ConversationCommand.Research]: async for research_result in execute_information_collection( request=request,