From b7fad048707e3621f1c6770fed478bbcf8950ec6 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Sat, 9 Mar 2024 18:57:47 +0530 Subject: [PATCH] Use consistent field name for queries in chat history & better image prompt --- src/khoj/routers/helpers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/khoj/routers/helpers.py b/src/khoj/routers/helpers.py index 469bfa40..f8c355fa 100644 --- a/src/khoj/routers/helpers.py +++ b/src/khoj/routers/helpers.py @@ -465,8 +465,8 @@ async def text_to_image( chat_history += f"Q: {chat['intent']['query']}\n" chat_history += f"A: {chat['message']}\n" elif chat["by"] == "khoj" and "text-to-image" in chat["intent"].get("type"): - chat_history += f"Q: {chat['intent']['query']}\n" - chat_history += f"A: [generated image redacted by admin]. Enhanced image prompt: {chat['intent']['inferred-queries'][0]}\n" + chat_history += f"Q: Query: {chat['intent']['query']}\n" + chat_history += f"A: Improved Query: {chat['intent']['inferred-queries'][0]}\n" try: with timer("Improve the original user query", logger): improved_image_prompt = await generate_better_image_prompt(