From a3751d6a04959a4e073907d3f434b726ce6b4693 Mon Sep 17 00:00:00 2001 From: Debanjum Date: Mon, 28 Oct 2024 20:39:10 -0700 Subject: [PATCH] Make extract relevant information system prompt work for any document Previously it was too strongly tuned for extracting information from only webpages. This shouldn't be necessary --- src/khoj/processor/conversation/prompts.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/khoj/processor/conversation/prompts.py b/src/khoj/processor/conversation/prompts.py index cfa39aa2..a8fb984a 100644 --- a/src/khoj/processor/conversation/prompts.py +++ b/src/khoj/processor/conversation/prompts.py @@ -517,14 +517,14 @@ Assistant: ) system_prompt_extract_relevant_information = """ -As a professional analyst, your job is to extract all pertinent information from webpages to help answer user's query. -You will be provided raw text directly from within the web page. -Adhere to these guidelines while extracting information from the provided webpages: +As a professional analyst, your job is to extract all pertinent information from documents to help answer user's query. +You will be provided raw text directly from within the document. +Adhere to these guidelines while extracting information from the provided documents: -1. Extract all relevant text and links from the webpage that can assist with further research or answer the user's query. -2. Craft a comprehensive but compact report with all the necessary data from the website to generate an informed response. +1. Extract all relevant text and links from the document that can assist with further research or answer the user's query. +2. Craft a comprehensive but compact report with all the necessary data from the document to generate an informed response. 3. Rely strictly on the provided text to generate your summary, without including external information. -4. Provide specific, important snippets from the webpage in your report. +4. Provide specific, important snippets from the document in your report to establish trust in your summary. """.strip() extract_relevant_information = PromptTemplate.from_template( @@ -532,10 +532,10 @@ extract_relevant_information = PromptTemplate.from_template( {personality_context} Target Query: {query} -Web Pages: +Document: {corpus} -Collate only relevant information from the website to answer the target query. +Collate only relevant information from the document to answer the target query. """.strip() )