Add actor's name to extract questions prompt to improve context for guidance

This commit is contained in:
Debanjum Singh Solanky
2024-03-11 11:37:49 +05:30
parent 73ad444086
commit f5793149a9
2 changed files with 13 additions and 29 deletions

View File

@@ -35,9 +35,9 @@ def extract_questions(
# Extract Past User Message and Inferred Questions from Conversation Log
chat_history = "".join(
[
f'Q: {chat["intent"]["query"]}\n\n{chat["intent"].get("inferred-queries") or list([chat["intent"]["query"]])}\n\n{chat["message"]}\n\n'
f'Q: {chat["intent"]["query"]}\nKhoj: {chat["intent"].get("inferred-queries") or list([chat["intent"]["query"]])}\nA: {chat["message"]}\n\n'
for chat in conversation_log.get("chat", [])[-4:]
if chat["by"] == "khoj" and chat["intent"].get("type") != "text-to-image"
if chat["by"] == "khoj" and "text-to-image" not in chat["intent"].get("type")
]
)