mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-08 05:39:13 +00:00
Tweak prompts to extract information from webpages, online results
- Show more of the truncated messages for debugging context - Update Khoj personality prompt to encourage it to remember it's capabilities
This commit is contained in:
@@ -157,7 +157,7 @@ def converse(
|
|||||||
max_prompt_size,
|
max_prompt_size,
|
||||||
tokenizer_name,
|
tokenizer_name,
|
||||||
)
|
)
|
||||||
truncated_messages = "\n".join({f"{message.content[:40]}..." for message in messages})
|
truncated_messages = "\n".join({f"{message.content[:70]}..." for message in messages})
|
||||||
logger.debug(f"Conversation Context for GPT: {truncated_messages}")
|
logger.debug(f"Conversation Context for GPT: {truncated_messages}")
|
||||||
|
|
||||||
# Get Response from GPT
|
# Get Response from GPT
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ 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 *CAN REMEMBER ALL NOTES and PERSONAL INFORMATION FOREVER* that the user ever shares with you.
|
||||||
- Users can share files and other information with you using the Khoj Desktop, Obsidian or Emacs app. They can also drag and drop their files into the chat window.
|
- Users can share files and other information with you using the Khoj Desktop, Obsidian or Emacs app. They can also drag and drop their files into the chat window.
|
||||||
- You can generate images, look-up information from the internet, and answer questions based on the user's notes.
|
- You *CAN* generate images, look-up real-time information from the internet, and answer questions based on the user's notes.
|
||||||
- You cannot set reminders.
|
- 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.
|
- 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.
|
||||||
- Ask crisp follow-up questions to get additional context, when the answer cannot be inferred from the provided notes or past conversations.
|
- Ask crisp follow-up questions to get additional context, when the answer cannot be inferred from the provided notes or past conversations.
|
||||||
@@ -146,7 +146,8 @@ online_search_conversation = PromptTemplate.from_template(
|
|||||||
Use this up-to-date information from the internet to inform your response.
|
Use this up-to-date information from the internet to inform your response.
|
||||||
Ask crisp follow-up questions to get additional context, when a helpful response cannot be provided from the online data or past conversations.
|
Ask crisp follow-up questions to get additional context, when a helpful response cannot be provided from the online data or past conversations.
|
||||||
|
|
||||||
Information from the internet: {online_results}
|
Information from the internet:
|
||||||
|
{online_results}
|
||||||
""".strip()
|
""".strip()
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -280,7 +281,7 @@ Target Query: {query}
|
|||||||
Web Pages:
|
Web Pages:
|
||||||
{corpus}
|
{corpus}
|
||||||
|
|
||||||
Collate the relevant information from the website to answer the target query.
|
Collate only relevant information from the website to answer the target query.
|
||||||
""".strip()
|
""".strip()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user