Only include inferred queries in the conversation history for images, not links. Overflow the side panel when too long

This commit is contained in:
sabaimran
2024-03-09 11:59:22 +05:30
parent 42d4bc6b14
commit 12d6c4da7d
2 changed files with 3 additions and 1 deletions

View File

@@ -1449,6 +1449,8 @@ To get started, just start typing below. You can also type / to see a list of co
overflow-y: scroll;
text-align: left;
transition: width 0.3s ease-in-out;
max-height: 85vh;
overflow-y: auto;
}
div#side-panel.collapsed {

View File

@@ -118,7 +118,7 @@ def construct_chat_history(conversation_history: dict, n: int = 4) -> str:
if chat["by"] == "khoj" and chat["intent"].get("type") == "remember":
chat_history += f"User: {chat['intent']['query']}\n"
chat_history += f"Khoj: {chat['message']}\n"
elif chat["by"] == "khoj" and chat["intent"].get("type") == "text-to-image":
elif chat["by"] == "khoj" and ("text-to-image" in chat["intent"].get("type")):
chat_history += f"User: {chat['intent']['query']}\n"
chat_history += f"Khoj: [generated image redacted for space]\n"
return chat_history