From 01a58b71a5113bb286bb7f81664b9e0b1997a801 Mon Sep 17 00:00:00 2001 From: sabaimran Date: Thu, 10 Oct 2024 18:06:29 -0700 Subject: [PATCH] Skip image, code generation if in research mode --- src/khoj/routers/api_chat.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/khoj/routers/api_chat.py b/src/khoj/routers/api_chat.py index 48ca10f6..271a5d52 100644 --- a/src/khoj/routers/api_chat.py +++ b/src/khoj/routers/api_chat.py @@ -952,7 +952,7 @@ async def chat( ) ## Gather Code Results - if ConversationCommand.Code in conversation_commands: + if ConversationCommand.Code in conversation_commands and pending_research: try: previous_iteration_history = ( f"# Iteration 1:\n#---\nNotes:\n{compiled_references}\n\nOnline Results:{online_results}" @@ -993,7 +993,7 @@ async def chat( # Generate Output ## Generate Image Output - if ConversationCommand.Image in conversation_commands: + if ConversationCommand.Image in conversation_commands and pending_research: async for result in text_to_image( q, user,