Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,8 @@ import gradio as gr
|
|
3 |
import requests
|
4 |
import inspect
|
5 |
import pandas as pd
|
|
|
|
|
6 |
|
7 |
# (Keep Constants as is)
|
8 |
# --- Constants ---
|
@@ -11,7 +13,6 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
11 |
# --- Basic Agent Definition ---
|
12 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
13 |
from smolagents import CodeAgent, HfApiModel
|
14 |
-
from tools import WikipediaTool
|
15 |
from tools import TextTransformerTool
|
16 |
|
17 |
class BasicAgent:
|
@@ -19,12 +20,12 @@ class BasicAgent:
|
|
19 |
print("Initializing BasicAgent with tools...")
|
20 |
|
21 |
model = HfApiModel()
|
22 |
-
|
23 |
text_tool = TextTransformerTool()
|
24 |
|
25 |
self.agent = CodeAgent(
|
26 |
model=model,
|
27 |
-
tools=[
|
28 |
add_base_tools=True,
|
29 |
planning_interval=2
|
30 |
)
|
|
|
3 |
import requests
|
4 |
import inspect
|
5 |
import pandas as pd
|
6 |
+
from smolagents import CodeAgent, HfApiModel, DuckDuckGoSearchTool
|
7 |
+
from tools.text_transformer_tool import TextTransformerTool
|
8 |
|
9 |
# (Keep Constants as is)
|
10 |
# --- Constants ---
|
|
|
13 |
# --- Basic Agent Definition ---
|
14 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
15 |
from smolagents import CodeAgent, HfApiModel
|
|
|
16 |
from tools import TextTransformerTool
|
17 |
|
18 |
class BasicAgent:
|
|
|
20 |
print("Initializing BasicAgent with tools...")
|
21 |
|
22 |
model = HfApiModel()
|
23 |
+
search_tool = DuckDuckGoSearchTool()
|
24 |
text_tool = TextTransformerTool()
|
25 |
|
26 |
self.agent = CodeAgent(
|
27 |
model=model,
|
28 |
+
tools=[search_tool, text_tool],
|
29 |
add_base_tools=True,
|
30 |
planning_interval=2
|
31 |
)
|