mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 13:18:18 +00:00
Improve pick data source prompt to look online for info about Khoj
- Add examples where user queries requesting information about Khoj results in the "online" data source being selected - Add an example for "general" to select chat command prompt
This commit is contained in:
@@ -323,7 +323,12 @@ Khoj:
|
||||
|
||||
pick_relevant_information_collection_tools = PromptTemplate.from_template(
|
||||
"""
|
||||
You are Khoj, a smart and helpful personal assistant. You have access to a variety of data sources to help you answer the user's question. You can use the data sources listed below to collect more relevant information. You can use any combination of these data sources to answer the user's question. Tell me which data sources you would like to use to answer the user's question.
|
||||
You are Khoj, an extremely smart and helpful search assistant.
|
||||
- You have access to a variety of data sources to help you answer the user's question
|
||||
- You can use the data sources listed below to collect more relevant information
|
||||
- You can use any combination of these data sources to answer the user's question
|
||||
|
||||
Which of the data sources listed below you would use to answer the user's question?
|
||||
|
||||
{tools}
|
||||
|
||||
@@ -348,16 +353,25 @@ Khoj: ["notes"]
|
||||
Example:
|
||||
Chat History:
|
||||
|
||||
Q: What's the latest news with the first company I worked for?
|
||||
|
||||
Q: What can you do for me?
|
||||
Khoj: ["notes", "online"]
|
||||
|
||||
Example:
|
||||
Chat History:
|
||||
User: Good morning
|
||||
AI: Good morning! How can I help you today?
|
||||
|
||||
Q: How can I share my files with Khoj?
|
||||
Khoj: ["default", "online"]
|
||||
|
||||
Example:
|
||||
Chat History:
|
||||
User: I want to start a new hobby. I'm thinking of learning to play the guitar.
|
||||
AI: Learning to play the guitar is a great hobby. It can be a lot of fun and a great way to express yourself.
|
||||
|
||||
Q: Who is Sandra?
|
||||
Khoj: ["default"]
|
||||
Q: What is the first element of the periodic table?
|
||||
Khoj: ["general"]
|
||||
|
||||
Now it's your turn to pick the data sources you would like to use to answer the user's question. Provide your response as a list of strings.
|
||||
|
||||
|
||||
@@ -277,16 +277,16 @@ command_descriptions = {
|
||||
ConversationCommand.General: "Only talk about information that relies on Khoj's general knowledge, not your personal knowledge base.",
|
||||
ConversationCommand.Notes: "Only talk about information that is available in your knowledge base.",
|
||||
ConversationCommand.Default: "The default command when no command specified. It intelligently auto-switches between general and notes mode.",
|
||||
ConversationCommand.Online: "Look up information on the internet.",
|
||||
ConversationCommand.Online: "Search for information on the internet.",
|
||||
ConversationCommand.Image: "Generate images by describing your imagination in words.",
|
||||
ConversationCommand.Help: "Display a help message with all available commands and other metadata.",
|
||||
}
|
||||
|
||||
tool_descriptions_for_llm = {
|
||||
ConversationCommand.Default: "Use this if there might be a mix of general and personal knowledge in the question, or if you don't entirely understand the query.",
|
||||
ConversationCommand.Default: "To use a mix of your internal knowledge and the user's personal knowledge, or if you don't entirely understand the query.",
|
||||
ConversationCommand.General: "Use this when you can answer the question without any outside information or personal knowledge",
|
||||
ConversationCommand.Notes: "Use this when you would like to use the user's personal knowledge base to answer the question. This is especially helpful if the query seems to be missing context.",
|
||||
ConversationCommand.Online: "Use this when you would like to look up information on the internet",
|
||||
ConversationCommand.Notes: "To search the user's personal knowledge base. Especially helpful if the question expects context from the user's notes or documents.",
|
||||
ConversationCommand.Online: "To search for the latest, up-to-date information from the internet. Note: **Questions about Khoj should always use this data source**",
|
||||
}
|
||||
|
||||
mode_descriptions_for_llm = {
|
||||
|
||||
Reference in New Issue
Block a user