bstraehle commited on
Commit
1c61347
·
verified ·
1 Parent(s): 8df193a

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +9 -9
agent.py CHANGED
@@ -35,26 +35,26 @@ def run_agent(level, question, file_name, ground_truth):
35
  get_final_answer(question, answer):
36
  client = OpenAI()
37
 
38
- prompt = """
39
- You are given a question and a preliminary answer:
40
- Question: {question}
41
- Preliminary answer: {answer}
42
- You must give the precise answer requested. Do not include explanations, steps, reasoning, or additional text. Be direct and specific.
43
  For example, if asked "What is the capital of France?", respond simply with "Paris".
44
  """
45
 
46
  completion = client.chat.completions.create(
47
  max_tokens = 1000,
48
  messages = [{"role": "user",
49
- "content": [{"type": "text", "text": prompt}],
50
  model = MODEL_ID,
51
  temperature = 0.0
52
  )
53
 
54
- content = completion.choices[0].message.content
55
 
56
  print("###")
57
- print(content)
58
  print("###")
59
 
60
- return content
 
35
  get_final_answer(question, answer):
36
  client = OpenAI()
37
 
38
+ prompt_template = """
39
+ You are given a question and an answer:
40
+ Question: """ + question + """
41
+ Answer: """ + answer + """
42
+ You must ONLY give the precise answer requested. Do not include explanations, steps, reasoning, or additional text. Be direct and specific.
43
  For example, if asked "What is the capital of France?", respond simply with "Paris".
44
  """
45
 
46
  completion = client.chat.completions.create(
47
  max_tokens = 1000,
48
  messages = [{"role": "user",
49
+ "content": [{"type": "text", "text": prompt_template}],
50
  model = MODEL_ID,
51
  temperature = 0.0
52
  )
53
 
54
+ final_answer = completion.choices[0].message.content
55
 
56
  print("###")
57
+ print(prompt_template)
58
  print("###")
59
 
60
+ return final_answer