Fix triggering @general queries in Khoj Chat

This commit is contained in:
Debanjum Singh Solanky
2023-06-19 22:55:32 -07:00
parent e97a20d70c
commit 79d325fbb6
2 changed files with 2 additions and 5 deletions

View File

@@ -153,7 +153,7 @@ def converse(references, user_query, conversation_log={}, model="gpt-3.5-turbo",
compiled_references = "\n\n".join({f"# {item}" for item in references})
# Get Conversation Primer appropriate to Conversation Type
if compiled_references == []:
if compiled_references == "":
conversation_primer = prompts.general_conversation.format(current_date=current_date, query=user_query)
else:
conversation_primer = prompts.notes_conversation.format(

View File

@@ -283,10 +283,7 @@ def chat(q: Optional[str] = None, client: Optional[str] = None):
# If user query is empty, return chat history
if not q:
if meta_log.get("chat"):
return {"status": "ok", "response": meta_log["chat"]}
else:
return {"status": "ok", "response": []}
return {"status": "ok", "response": meta_log.get("chat", [])}
# Initialize Variables
api_key = state.processor_config.conversation.openai_api_key