From 311d58e1ed432a0d5ed4dfefc484ef77bfe6eb6f Mon Sep 17 00:00:00 2001 From: sabaimran Date: Tue, 30 Apr 2024 20:07:33 +0530 Subject: [PATCH] Ensure the automated_task command is removed from the prepended query --- src/khoj/routers/api_chat.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/khoj/routers/api_chat.py b/src/khoj/routers/api_chat.py index 882937b9..ae3f7cd9 100644 --- a/src/khoj/routers/api_chat.py +++ b/src/khoj/routers/api_chat.py @@ -377,7 +377,7 @@ async def websocket_endpoint( is_automated_task = conversation_commands == [ConversationCommand.AutomatedTask] if conversation_commands == [ConversationCommand.Default] or is_automated_task: - conversation_commands = await aget_relevant_information_sources(q, meta_log) + conversation_commands = await aget_relevant_information_sources(q, meta_log, is_automated_task) conversation_commands_str = ", ".join([cmd.value for cmd in conversation_commands]) await send_status_update(f"**🗃️ Chose Data Sources to Search:** {conversation_commands_str}") @@ -626,11 +626,11 @@ async def chat( else: meta_log = conversation.conversation_log - is_task = conversation_commands == [ConversationCommand.AutomatedTask] + is_automated_task = conversation_commands == [ConversationCommand.AutomatedTask] - if conversation_commands == [ConversationCommand.Default] or is_task: - conversation_commands = await aget_relevant_information_sources(q, meta_log) - mode = await aget_relevant_output_modes(q, meta_log, is_task) + if conversation_commands == [ConversationCommand.Default] or is_automated_task: + conversation_commands = await aget_relevant_information_sources(q, meta_log, is_automated_task) + mode = await aget_relevant_output_modes(q, meta_log, is_automated_task) if mode not in conversation_commands: conversation_commands.append(mode)