davemasino commited on
Commit
3f6db88
·
1 Parent(s): ebee0e4

Fix up prompt formatting

Browse files
Files changed (1) hide show
  1. agent.py +8 -14
agent.py CHANGED
@@ -19,22 +19,16 @@ class BasicAgent:
19
  model=model,
20
  tools=[DuckDuckGoSearchTool()]
21
  )
22
- prompt = f"""\
23
- You are a general AI assistant. I will ask you a question. Report your thoughts,
24
- and finish your answer with the following template:
25
- FINAL ANSWER: YOUR FINAL ANSWER
26
- YOUR FINAL ANSWER should be a number OR as few words as possible OR a comma-
27
- separated list of numbers and/or strings.
28
-
29
- If you are asked for a number, do NOT use commas or units (%, $, etc.) unless
30
- explicitly requested. If you are asked for a string, do NOT use articles or
31
- abbreviations (e.g. for cities) and write digits in plain text unless
32
- specified otherwise. If you are asked for a comma-separated list, apply the
33
- above rules to each element.
34
 
35
  {question}
36
- """
37
- answer = agent.run(prompt)
38
 
39
  print(f"Agent returning answer: {answer}")
40
  return answer
 
19
  model=model,
20
  tools=[DuckDuckGoSearchTool()]
21
  )
22
+ prompt = f"""You are a general AI assistant. I will ask you a question. Report your thoughts, and
23
+ finish your answer with the following template: FINAL ANSWER: [YOUR FINAL ANSWER]. YOUR FINAL ANSWER should
24
+ be a number OR as few words as possible OR a comma separated list of numbers and/or strings. If you are asked
25
+ for a number, don't use comma to write your number neither use units such as $ or percent sign unless specified
26
+ otherwise. If you are asked for a string, don't use articles, neither abbreviations (e.g. for cities), and
27
+ write the digits in plain text unless specified otherwise. If you are asked for a comma separated list, apply
28
+ the above rules depending of whether the element to be put in the list is a number or a string.
 
 
 
 
 
29
 
30
  {question}
31
+ """ answer = agent.run(prompt)
 
32
 
33
  print(f"Agent returning answer: {answer}")
34
  return answer