STARX33 commited on
Commit
4c6b162
·
verified ·
1 Parent(s): c1074ea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -6
app.py CHANGED
@@ -3,7 +3,15 @@ import gradio as gr
3
  import requests
4
  import pandas as pd
5
 
6
- from smolagents import CodeAgent, HfApiModel
 
 
 
 
 
 
 
 
7
 
8
  # === Constants ===
9
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
@@ -15,13 +23,21 @@ class BasicAgent:
15
 
16
  self.agent = CodeAgent(
17
  model=model,
18
- tools=[], # Manual tool loading not used
19
- add_base_tools=True, # Enables certified vision + search tools
20
  max_steps=6,
21
- name="EvalAgent",
22
- description="Certification agent using built-in search and vision tools"
23
  )
24
- print("✅ BasicAgent initialized with add_base_tools=True")
 
 
 
 
 
 
 
 
25
 
26
  def __call__(self, question: str) -> str:
27
  return self.agent.run(question)
 
3
  import requests
4
  import pandas as pd
5
 
6
+ from smolagents import CodeAgent
7
+ from smolagents.models import HfApiModel
8
+ from smolagents.tools.common_tools import (
9
+ describe_image_with_blip,
10
+ transcribe_audio_to_text,
11
+ load_csv_to_dataframe,
12
+ get_current_time_in_timezone,
13
+ )
14
+ from smolagents.tools.web import DuckDuckGoSearchTool
15
 
16
  # === Constants ===
17
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
 
23
 
24
  self.agent = CodeAgent(
25
  model=model,
26
+ tools=[], # Tools will be added manually below
27
+ add_base_tools=False,
28
  max_steps=6,
29
+ name="FullEvalAgent",
30
+ description="Certification agent using extended tools for full coverage"
31
  )
32
+
33
+ self.agent.add_tools([
34
+ DuckDuckGoSearchTool(),
35
+ describe_image_with_blip,
36
+ transcribe_audio_to_text,
37
+ load_csv_to_dataframe,
38
+ get_current_time_in_timezone
39
+ ])
40
+ print("✅ BasicAgent initialized with full toolset")
41
 
42
  def __call__(self, question: str) -> str:
43
  return self.agent.run(question)