Spaces:
Running
Running
ffreemt
commited on
Commit
·
7b0f470
1
Parent(s):
3df980b
Fix BasicAgent app.py
Browse files- app.py +12 -2
- basic_agent.py +1 -0
app.py
CHANGED
@@ -5,13 +5,16 @@ import os
|
|
5 |
import gradio as gr
|
6 |
import pandas as pd
|
7 |
import requests
|
|
|
8 |
import wikipediaapi
|
9 |
from basic_agent import BasicAgent
|
|
|
10 |
from mcp import StdioServerParameters
|
11 |
-
from smolagents import
|
12 |
from ycecream import y
|
13 |
|
14 |
y.configure(sln=1)
|
|
|
15 |
|
16 |
# (Keep Constants as is)
|
17 |
# --- Constants ---
|
@@ -52,7 +55,14 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
52 |
|
53 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
54 |
try:
|
55 |
-
agent = BasicAgent(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
except Exception as e:
|
57 |
print(f"Error instantiating agent: {e}")
|
58 |
return f"Error initializing agent: {e}", None
|
|
|
5 |
import gradio as gr
|
6 |
import pandas as pd
|
7 |
import requests
|
8 |
+
import rich
|
9 |
import wikipediaapi
|
10 |
from basic_agent import BasicAgent
|
11 |
+
from get_model import get_model
|
12 |
from mcp import StdioServerParameters
|
13 |
+
from smolagents import DuckDuckGoSearchTool, FinalAnswerTool, Tool, ToolCollection, VisitWebpageTool
|
14 |
from ycecream import y
|
15 |
|
16 |
y.configure(sln=1)
|
17 |
+
print = rich.get_console().print
|
18 |
|
19 |
# (Keep Constants as is)
|
20 |
# --- Constants ---
|
|
|
55 |
|
56 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
57 |
try:
|
58 |
+
agent = BasicAgent(
|
59 |
+
model=get_model(cat="gemini"),
|
60 |
+
tools=[
|
61 |
+
DuckDuckGoSearchTool(),
|
62 |
+
VisitWebpageTool(),
|
63 |
+
FinalAnswerTool(),
|
64 |
+
]
|
65 |
+
)
|
66 |
except Exception as e:
|
67 |
print(f"Error instantiating agent: {e}")
|
68 |
return f"Error initializing agent: {e}", None
|
basic_agent.py
CHANGED
@@ -103,6 +103,7 @@ def main():
|
|
103 |
tools=[
|
104 |
DuckDuckGoSearchTool(),
|
105 |
VisitWebpageTool(),
|
|
|
106 |
]
|
107 |
)
|
108 |
except Exception as e:
|
|
|
103 |
tools=[
|
104 |
DuckDuckGoSearchTool(),
|
105 |
VisitWebpageTool(),
|
106 |
+
FinalAnswerTool(),
|
107 |
]
|
108 |
)
|
109 |
except Exception as e:
|