mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 21:19:12 +00:00
Fix triggering @general queries in Khoj Chat
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user