mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-07 13:23:15 +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})
|
compiled_references = "\n\n".join({f"# {item}" for item in references})
|
||||||
|
|
||||||
# Get Conversation Primer appropriate to Conversation Type
|
# 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)
|
conversation_primer = prompts.general_conversation.format(current_date=current_date, query=user_query)
|
||||||
else:
|
else:
|
||||||
conversation_primer = prompts.notes_conversation.format(
|
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 user query is empty, return chat history
|
||||||
if not q:
|
if not q:
|
||||||
if meta_log.get("chat"):
|
return {"status": "ok", "response": meta_log.get("chat", [])}
|
||||||
return {"status": "ok", "response": meta_log["chat"]}
|
|
||||||
else:
|
|
||||||
return {"status": "ok", "response": []}
|
|
||||||
|
|
||||||
# Initialize Variables
|
# Initialize Variables
|
||||||
api_key = state.processor_config.conversation.openai_api_key
|
api_key = state.processor_config.conversation.openai_api_key
|
||||||
|
|||||||
Reference in New Issue
Block a user