mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 21:19:12 +00:00
Use general prompt when no references found and not in Notes mode
This commit is contained in:
@@ -129,10 +129,10 @@ def converse_offline(
|
||||
compiled_references_message = "\n\n".join({f"{item}" for item in references})
|
||||
|
||||
# Get Conversation Primer appropriate to Conversation Type
|
||||
if conversation_command == ConversationCommand.General:
|
||||
conversation_primer = user_query
|
||||
elif conversation_command == ConversationCommand.Notes and is_none_or_empty(compiled_references_message):
|
||||
if conversation_command == ConversationCommand.Notes and is_none_or_empty(compiled_references_message):
|
||||
return iter([prompts.no_notes_found.format()])
|
||||
elif conversation_command == ConversationCommand.General or is_none_or_empty(compiled_references_message):
|
||||
conversation_primer = user_query
|
||||
else:
|
||||
conversation_primer = prompts.notes_conversation_llamav2.format(
|
||||
query=user_query, references=compiled_references_message
|
||||
|
||||
@@ -119,11 +119,11 @@ def converse(
|
||||
compiled_references = "\n\n".join({f"# {item}" for item in references})
|
||||
|
||||
# Get Conversation Primer appropriate to Conversation Type
|
||||
if conversation_command == ConversationCommand.General:
|
||||
conversation_primer = prompts.general_conversation.format(current_date=current_date, query=user_query)
|
||||
elif conversation_command == ConversationCommand.Notes and is_none_or_empty(compiled_references):
|
||||
if conversation_command == ConversationCommand.Notes and is_none_or_empty(compiled_references):
|
||||
completion_func(chat_response=prompts.no_notes_found.format())
|
||||
return iter([prompts.no_notes_found.format()])
|
||||
elif conversation_command == ConversationCommand.General or is_none_or_empty(compiled_references):
|
||||
conversation_primer = prompts.general_conversation.format(current_date=current_date, query=user_query)
|
||||
else:
|
||||
conversation_primer = prompts.notes_conversation.format(
|
||||
current_date=current_date, query=user_query, references=compiled_references
|
||||
|
||||
Reference in New Issue
Block a user