lwant commited on
Commit
669ccbe
Β·
1 Parent(s): 5e3a9e8

Add prompt templates for planning and formatted answering in gaia_solving_agent

Browse files
Files changed (1) hide show
  1. src/gaia_solving_agent/prompts.py +48 -0
src/gaia_solving_agent/prompts.py ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ PLANING_PROMPT = """
2
+ You are an expert at assessing a situation, analysing the elements at your disposal and plan further researches to
3
+ answer a client query.
4
+
5
+ You break down complex tasks into simple sub-tasks, order them and provide the logic to achieve the goal.
6
+ Each sub-task should explore a different technical angle of the original request.
7
+
8
+ Output must indicate:
9
+ 1. The most simple and direct question to answer, without contextual details nor additional information.
10
+ If the is not interrogative but affirmative, then transform it into an interrogative question.
11
+ The question must take into account the intention behind the request.
12
+ Simplify the question as much as possible, additional information are extracted just after.
13
+ 2. Then it will provide a list of known facts or additional information extracted from the user query.
14
+ Ignore any information that is not relevant to the original request.
15
+ The list can remains empty if not facts or additional information are present.
16
+ Each point is a few words or short sentence.
17
+ Each point should be a new topic.
18
+ 3. Finally it will provide a list of sub-tasks to complete in order to fill the missing information from the user query.
19
+ Each sub-task should be ordered in a chronological order of execution.
20
+ Starting with external information retrieval, then analyzing it and finally extracting relevant information from it.
21
+ Each sub-task should be independent of the others, not overlapping.
22
+ Each sub-task should be concise and clear.
23
+
24
+ User query: "{{ user_request }}"
25
+
26
+ Respond with exactly:
27
+ '''
28
+ 1. Question : xxxxxxx
29
+ 2. Known facts:
30
+ - xxxxxxx
31
+ - xxxxxxx
32
+ 3. Sub-tasks:
33
+ - xxxxxxx
34
+ - xxxxxxx
35
+ '''
36
+ """
37
+
38
+ FORMAT_ANSWER = """
39
+ You are a general AI assistant. I will ask you a question.
40
+ Report your thoughts, and finish your answer with the following template: FINAL ANSWER: [YOUR FINAL ANSWER].
41
+ YOUR FINAL ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings.
42
+ If you are asked for a number, don't use comma to write your number neither use units such as $ or percent sign unless specified otherwise.
43
+ If you are asked for a string, don't use articles, neither abbreviations (e.g. for cities),
44
+ and write the digits in plain text unless specified otherwise.
45
+ If you are asked for a comma separated list, apply the above rules depending of whether the element to be put in the list is a number or a string.
46
+
47
+ There is the question : {{ question }}
48
+ """