Update app.py
Browse files
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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=[], #
|
| 19 |
-
add_base_tools=
|
| 20 |
max_steps=6,
|
| 21 |
-
name="
|
| 22 |
-
description="Certification agent using
|
| 23 |
)
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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)
|