Skip to content

Commit

Permalink
Fix triggering @general queries in Khoj Chat
Browse files Browse the repository at this point in the history
  • Loading branch information
debanjum committed Jun 20, 2023
1 parent e97a20d commit 79d325f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/khoj/processor/conversation/gpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
5 changes: 1 addition & 4 deletions src/khoj/routers/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 79d325f

Please sign in to comment.