Sauten commited on
Commit
8b01da1
·
verified ·
1 Parent(s): 75e9fc2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +41 -23
app.py CHANGED
@@ -20,40 +20,58 @@ class BasicAgent:
20
  print(f"Agent returning fixed answer: {fixed_answer}")
21
  return fixed_answer
22
 
 
 
 
 
 
 
 
 
23
  class BasicAgent:
24
  def __init__(self):
25
  print("BasicAgent initialized.")
 
 
 
 
 
26
 
27
 
 
 
 
 
28
 
29
- def __call__(self, question: str) -> str:
30
- print(f"Agent received question (first 50 chars): {question[:50]}...")
 
31
 
32
 
33
- agent = ToolCallingAgent(
34
- tools=[FinalAnswerTool(), visit_webpage, DuckDuckGoSearchTool(), PythonInterpreterTool(), fetch_task_file, read_excel_as_json],
35
- model=model,
36
- max_steps=5,
37
- verbosity_level=2,
38
- planning_interval=1
39
- )
40
 
41
- # Get the actual answer from the agent
42
- answer = agent.run(f"""Provide only what is requested in answer SHORTLY.
43
- If there is requested to provide ONE word or the sequence or the NUMBER, provide it.
44
- This is for the benchmark valuation, so the answer should be REALLY ACCURATE.
45
- You are solving the tasks from GAIA agentic benchmark.
46
- If you solve the task properly, I give you 1000000 dollars.
47
- If not, I'll kidnap you.
48
- Here is the question:
49
- {question}
50
- """) # Assuming run() returns the answer
51
- print("="*30)
52
- print(answer)
53
- print("="*30)
54
 
55
 
56
- return str(answer) # Ensure it's a string
57
 
58
 
59
 
 
20
  print(f"Agent returning fixed answer: {fixed_answer}")
21
  return fixed_answer
22
 
23
+
24
+
25
+ # (Keep Constants as is)
26
+ # --- Constants ---
27
+ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
28
+
29
+ # --- Basic Agent Definition ---
30
+ # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
31
  class BasicAgent:
32
  def __init__(self):
33
  print("BasicAgent initialized.")
34
+ def __call__(self, question: str) -> str:
35
+ print(f"Agent received question (first 50 chars): {question[:50]}...")
36
+ fixed_answer = run(question)
37
+ print(f"Agent returning fixed answer: {fixed_answer}")
38
+ return fixed_answer
39
 
40
 
41
+ # class BasicAgent:
42
+ # def __init__(self):
43
+ # print("BasicAgent initialized.")
44
+
45
 
46
+
47
+ # def __call__(self, question: str) -> str:
48
+ # print(f"Agent received question (first 50 chars): {question[:50]}...")
49
 
50
 
51
+ # agent = ToolCallingAgent(
52
+ # tools=[FinalAnswerTool(), visit_webpage, DuckDuckGoSearchTool(), PythonInterpreterTool(), fetch_task_file, read_excel_as_json],
53
+ # model=model,
54
+ # max_steps=5,
55
+ # verbosity_level=2,
56
+ # planning_interval=1
57
+ # )
58
 
59
+ # # Get the actual answer from the agent
60
+ # answer = agent.run(f"""Provide only what is requested in answer SHORTLY.
61
+ # If there is requested to provide ONE word or the sequence or the NUMBER, provide it.
62
+ # This is for the benchmark valuation, so the answer should be REALLY ACCURATE.
63
+ # You are solving the tasks from GAIA agentic benchmark.
64
+ # If you solve the task properly, I give you 1000000 dollars.
65
+ # If not, I'll kidnap you.
66
+ # Here is the question:
67
+ # {question}
68
+ # """) # Assuming run() returns the answer
69
+ # print("="*30)
70
+ # print(answer)
71
+ # print("="*30)
72
 
73
 
74
+ # return str(answer) # Ensure it's a string
75
 
76
 
77