From c6c48cfc18cb712fc9aad285bdbfa8d8bd5affe0 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Thu, 17 Oct 2024 13:34:56 -0700 Subject: [PATCH] Fix arg to generate_summary_from_file and type of this_iteration --- src/khoj/processor/conversation/utils.py | 2 +- src/khoj/routers/helpers.py | 2 +- src/khoj/routers/research.py | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/khoj/processor/conversation/utils.py b/src/khoj/processor/conversation/utils.py index f875f0af..6546595e 100644 --- a/src/khoj/processor/conversation/utils.py +++ b/src/khoj/processor/conversation/utils.py @@ -84,7 +84,7 @@ class InformationCollectionIteration: self, tool: str, query: str, - context: Dict[str, Dict] = None, + context: list = None, onlineContext: dict = None, codeContext: dict = None, summarizedResult: str = None, diff --git a/src/khoj/routers/helpers.py b/src/khoj/routers/helpers.py index cd051138..b05a0642 100644 --- a/src/khoj/routers/helpers.py +++ b/src/khoj/routers/helpers.py @@ -647,8 +647,8 @@ async def generate_summary_from_files( q, contextual_data, conversation_history=meta_log, - subscribed=subscribed, uploaded_image_url=uploaded_image_url, + user=user, agent=agent, ) response_log = str(response) diff --git a/src/khoj/routers/research.py b/src/khoj/routers/research.py index b8f4301a..80a673c9 100644 --- a/src/khoj/routers/research.py +++ b/src/khoj/routers/research.py @@ -147,6 +147,7 @@ async def execute_information_collection( code_results: Dict = dict() compiled_references: List[Any] = [] inferred_queries: List[Any] = [] + this_iteration = InformationCollectionIteration(tool=None, query=query) previous_iterations_history = construct_iteration_history(previous_iterations, prompts.previous_iteration) async for result in apick_next_tool( @@ -163,7 +164,7 @@ async def execute_information_collection( ): if isinstance(result, dict) and ChatEvent.STATUS in result: yield result[ChatEvent.STATUS] - else: + elif isinstance(result, InformationCollectionIteration): this_iteration = result if this_iteration.tool == ConversationCommand.Notes: