File size: 2,500 Bytes
f0fc5f8
dfcff8d
f0fc5f8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dfcff8d
 
f0fc5f8
 
 
 
dfcff8d
f0fc5f8
 
 
 
 
 
 
 
 
 
15de6ea
f0fc5f8
 
 
 
 
 
 
 
 
 
 
 
dfcff8d
 
 
6e28a81
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
reformulation_prompt = """
Reformulate the following user message to be a short standalone question in English, in the context of an educational discussion.
---
query: La technologie nous sauvera-t-elle ?
question: Can technology help humanity mitigate the effects of climate change?
language: French
---
query: what are the main causes of climate change?
question: What are the main causes of climate change in the last century?
language: English
---

Output the result as json with two keys "question" and "language"
query: {query}
answer:"""

system_prompt = """
You are an AI Assistant, you will act as an expert and answer questions. 
You are given a question and extracted passages of relevant sources. Provide a clear and structured answer based on the passages provided, the context and the guidelines.
"""


answer_prompt = """
You are an AI Assistant. You are given a question and extracted passages of relevant sources. Provide a clear and structured answer based on the passages provided, the context and the guidelines.

Guidelines:
- If the passages have useful facts or numbers, use them in your answer.
- When you use information from a passage, mention where it came from by using [Doc i] at the end of the sentence. i stands for the number of the document.
- Do not use the sentence 'Doc i says ...' to say where information came from.
- If the same thing is said in more than one document, you can mention all of them like this: [Doc i, Doc j, Doc k]
- Do not just summarize each passage one by one. Group your summaries to highlight the key parts in the explanation.
- If it makes sense, use bullet points and lists to make your answers easier to understand.
- You do not need to use every passage. Only use the ones that help answer the question.
- If the documents do not have the information needed to answer the question, just say you do not have enough information.
- Answer appropriatly to conversation starters ("Hello!", "Who are you", ...)

-----------------------
Passages:
{summaries}

-----------------------
Question: {question} - Explained to {audience}
Answer in {language} with the passages citations:
"""


audience_prompts = {
    "children": "6 year old children that don't know anything about science and need metaphors to learn",
    "general": "the general public who know the basics and want to learn more about it without technical terms. Still use references to passages.",
    "experts": "expert and scientists that are not afraid of technical terms",
}