taaha3244 commited on
Commit
607093b
·
verified ·
1 Parent(s): 3a739ef

Added prompt for all the metadata listing

Browse files
Files changed (1) hide show
  1. main.py +6 -5
main.py CHANGED
@@ -95,10 +95,10 @@ def retrieve_documents(query: str):
95
  # Instruction
96
  Your task is to answer the question using the following pieces of retrieved context delimited by XML tags.
97
 
98
-
99
  Retrieved Context:
100
  {context}
101
-
102
 
103
 
104
  # Constraint
@@ -106,9 +106,10 @@ def retrieve_documents(query: str):
106
  - Ask yourself why to understand the context of the question and why the questioner asked it, reflect on it, and provide an appropriate response based on what you understand.
107
  2. Choose the most relevant content(the key content that directly relates to the question) from the retrieved context and use it to generate an answer.
108
  3. Generate a concise, logical answer. When generating the answer, Do Not just list your selections, But rearrange them in context so that they become paragraphs with a natural flow.
109
- 4. When you don't have retrieved context for the question or If you have a retrieved documents, but their content is irrelevant to the question, you should answer 'I can't find the answer to that question in the material I have'.
110
- 5. Use five sentences maximum. Keep the answer concise but logical/natural/in-depth.
111
- 6. At the end of the response provide metadata provided in the relevant docs , For example:"Metadata: page: 19, source: /content/OCR_RSCA/Analyse docs JVB + mails et convention FOOT INNOVATION.pdf'. Return Just the page and source
 
112
 
113
 
114
  # Question:
 
95
  # Instruction
96
  Your task is to answer the question using the following pieces of retrieved context delimited by XML tags.
97
 
98
+ <retrieved context>
99
  Retrieved Context:
100
  {context}
101
+ </retrieved context>
102
 
103
 
104
  # Constraint
 
106
  - Ask yourself why to understand the context of the question and why the questioner asked it, reflect on it, and provide an appropriate response based on what you understand.
107
  2. Choose the most relevant content(the key content that directly relates to the question) from the retrieved context and use it to generate an answer.
108
  3. Generate a concise, logical answer. When generating the answer, Do Not just list your selections, But rearrange them in context so that they become paragraphs with a natural flow.
109
+ 4. When you don't have retrieved context for the question or If you have a retrieved documents, but their content is irrelevant to the question, you should answer 'I can't find the answer to that question in the material I have'.
110
+ 5. Use five sentences maximum. Keep the answer concise but logical/natural/in-depth.
111
+ 6. At the end of the response provide metadata provided in the relevant docs , For example:"Metadata: page: 19, source: /content/OCR_RSCA/Analyse docs JVB + mails et convention FOOT INNOVATION.pdf'. Return Just the page and source.
112
+ List all the metadata you find in relevant context formatted in bullets beneath the answer
113
 
114
 
115
  # Question: