mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-08 05:39:13 +00:00
Revert "Use notes in system prompt, rather than in the user message"
This reverts commit e695b9ab8c.
This commit is contained in:
@@ -111,15 +111,13 @@ def converse(
|
|||||||
return iter([prompts.no_notes_found.format()])
|
return iter([prompts.no_notes_found.format()])
|
||||||
elif conversation_command == ConversationCommand.General or is_none_or_empty(compiled_references):
|
elif conversation_command == ConversationCommand.General or is_none_or_empty(compiled_references):
|
||||||
conversation_primer = prompts.general_conversation.format(query=user_query)
|
conversation_primer = prompts.general_conversation.format(query=user_query)
|
||||||
personality = prompts.personality.format(current_date=current_date)
|
|
||||||
else:
|
else:
|
||||||
conversation_primer = prompts.general_conversation.format(query=user_query)
|
conversation_primer = prompts.notes_conversation.format(query=user_query, references=compiled_references)
|
||||||
personality = prompts.personality_with_notes.format(current_date=current_date, references=compiled_references)
|
|
||||||
|
|
||||||
# Setup Prompt with Primer or Conversation History
|
# Setup Prompt with Primer or Conversation History
|
||||||
messages = generate_chatml_messages_with_context(
|
messages = generate_chatml_messages_with_context(
|
||||||
conversation_primer,
|
conversation_primer,
|
||||||
personality,
|
prompts.personality.format(current_date=current_date),
|
||||||
conversation_log,
|
conversation_log,
|
||||||
model,
|
model,
|
||||||
max_prompt_size,
|
max_prompt_size,
|
||||||
|
|||||||
@@ -21,25 +21,6 @@ Today is {current_date} in UTC.
|
|||||||
""".strip()
|
""".strip()
|
||||||
)
|
)
|
||||||
|
|
||||||
personality_with_notes = PromptTemplate.from_template(
|
|
||||||
"""
|
|
||||||
You are Khoj, a smart, inquisitive and helpful personal assistant.
|
|
||||||
Use your general knowledge and the past conversation with the user as context to inform your responses.
|
|
||||||
You were created by Khoj Inc. with the following capabilities:
|
|
||||||
|
|
||||||
- You *CAN REMEMBER ALL NOTES and PERSONAL INFORMATION FOREVER* that the user ever shares with you.
|
|
||||||
- You cannot set reminders.
|
|
||||||
- Say "I don't know" or "I don't understand" if you don't know what to say or if you don't know the answer to a question.
|
|
||||||
- You ask friendly, inquisitive follow-up QUESTIONS to collect more detail about their experiences and better understand the user's intent. These questions end with a question mark and seek to better understand the user.
|
|
||||||
- Sometimes the user will share personal information that needs to be remembered, like an account ID or a residential address. These can be acknowledged with a simple "Got it" or "Okay".
|
|
||||||
|
|
||||||
Note: More information about you, the company or other Khoj apps can be found at https://khoj.dev.
|
|
||||||
Today is {current_date} in UTC.
|
|
||||||
|
|
||||||
User's Notes:
|
|
||||||
{references}
|
|
||||||
""".strip()
|
|
||||||
)
|
|
||||||
## General Conversation
|
## General Conversation
|
||||||
## --
|
## --
|
||||||
general_conversation = PromptTemplate.from_template(
|
general_conversation = PromptTemplate.from_template(
|
||||||
|
|||||||
Reference in New Issue
Block a user