politeles commited on
Commit
3590646
·
verified ·
1 Parent(s): 7d898d8

Update app.py

Browse files

expored check_reasoning outside the agent class

Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -11,10 +11,7 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
11
 
12
  # --- Basic Agent Definition ---
13
  # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
14
- class BasicAgent:
15
- agent = None
16
- web_agent = None
17
- def check_reasoning(self,final_answer,agent_memory):
18
  model = OpenAIServerModel("gpt-4o", max_tokens=8096)
19
  prompt = (
20
  f"Here is a user-given task and the agent steps: {agent_memory.get_succinct_steps()}."
@@ -38,6 +35,9 @@ class BasicAgent:
38
  if "FAIL" in output:
39
  raise Exception(output)
40
  return True
 
 
 
41
  def __init__(self):
42
  prompt = "You are a general AI assistant. I will ask you a question. Report your thoughts, and finish your answer with the following template: FINAL ANSWER: [YOUR FINAL ANSWER]. YOUR FINAL ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings. 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. If you are asked for a string, don't use articles, neither abbreviations (e.g. for cities), and write the digits in plain text unless specified otherwise. 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."
43
  model = InferenceClientModel(model_id="Qwen/Qwen2.5-Coder-32B-Instruct", provider="together")
 
11
 
12
  # --- Basic Agent Definition ---
13
  # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
14
+ def check_reasoning(final_answer,agent_memory):
 
 
 
15
  model = OpenAIServerModel("gpt-4o", max_tokens=8096)
16
  prompt = (
17
  f"Here is a user-given task and the agent steps: {agent_memory.get_succinct_steps()}."
 
35
  if "FAIL" in output:
36
  raise Exception(output)
37
  return True
38
+ class BasicAgent:
39
+ agent = None
40
+ web_agent = None
41
  def __init__(self):
42
  prompt = "You are a general AI assistant. I will ask you a question. Report your thoughts, and finish your answer with the following template: FINAL ANSWER: [YOUR FINAL ANSWER]. YOUR FINAL ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings. 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. If you are asked for a string, don't use articles, neither abbreviations (e.g. for cities), and write the digits in plain text unless specified otherwise. 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."
43
  model = InferenceClientModel(model_id="Qwen/Qwen2.5-Coder-32B-Instruct", provider="together")