mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-05 21:29:11 +00:00
Improve format of notes, online context passed to chat models in prompt
Improve separation of note snippets and show its origin file in notes prompt to have more readable, contextualized text shared with model. Previously the references dict was being directly passed as a string. The documents don't look well formatted and are less intelligible. - Passing file path along with notes snippets will help contextualize the notes better. - Better formatting should help with making notes more readable by the chat model.
This commit is contained in:
@@ -143,9 +143,8 @@ def converse(
|
||||
"""
|
||||
# Initialize Variables
|
||||
current_date = datetime.now()
|
||||
compiled_references = "\n\n".join({f"# {item['compiled']}" for item in references})
|
||||
|
||||
conversation_primer = prompts.query_prompt.format(query=user_query)
|
||||
compiled_references = "\n\n".join({f"# File: {item['file']}\n## {item['compiled']}\n" for item in references})
|
||||
|
||||
if agent and agent.personality:
|
||||
system_prompt = prompts.custom_personality.format(
|
||||
|
||||
Reference in New Issue
Block a user