Spaces:
Runtime error
Runtime error
Upload agent
Browse files- agent.json +3 -2
- app.py +4 -3
- tools/web_search.py +1 -1
agent.json
CHANGED
|
@@ -9,9 +9,10 @@
|
|
| 9 |
"final_answer"
|
| 10 |
],
|
| 11 |
"model": {
|
| 12 |
-
"class": "
|
| 13 |
"data": {
|
| 14 |
-
"model_id": "
|
|
|
|
| 15 |
}
|
| 16 |
},
|
| 17 |
"managed_agents": {},
|
|
|
|
| 9 |
"final_answer"
|
| 10 |
],
|
| 11 |
"model": {
|
| 12 |
+
"class": "LiteLLMModel",
|
| 13 |
"data": {
|
| 14 |
+
"model_id": "gemini/gemini-2.0-flash",
|
| 15 |
+
"api_base": null
|
| 16 |
}
|
| 17 |
},
|
| 18 |
"managed_agents": {},
|
app.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import yaml
|
| 2 |
import os
|
| 3 |
-
from smolagents import GradioUI, CodeAgent,
|
| 4 |
|
| 5 |
# Get current directory path
|
| 6 |
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
@@ -14,8 +14,9 @@ from tools.final_answer import FinalAnswerTool as FinalAnswer
|
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
-
model =
|
| 18 |
-
model_id='
|
|
|
|
| 19 |
)
|
| 20 |
|
| 21 |
web_search = WebSearch()
|
|
|
|
| 1 |
import yaml
|
| 2 |
import os
|
| 3 |
+
from smolagents import GradioUI, CodeAgent, LiteLLMModel
|
| 4 |
|
| 5 |
# Get current directory path
|
| 6 |
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
|
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
+
model = LiteLLMModel(
|
| 18 |
+
model_id='gemini/gemini-2.0-flash',
|
| 19 |
+
api_base=None,
|
| 20 |
)
|
| 21 |
|
| 22 |
web_search = WebSearch()
|
tools/web_search.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
from typing import Any, Optional
|
| 2 |
from smolagents.tools import Tool
|
| 3 |
-
import duckduckgo_search
|
| 4 |
import time
|
|
|
|
| 5 |
|
| 6 |
class DuckDuckGoSearchTool(Tool):
|
| 7 |
"""Web search tool that performs searches using the DuckDuckGo search engine.
|
|
|
|
| 1 |
from typing import Any, Optional
|
| 2 |
from smolagents.tools import Tool
|
|
|
|
| 3 |
import time
|
| 4 |
+
import duckduckgo_search
|
| 5 |
|
| 6 |
class DuckDuckGoSearchTool(Tool):
|
| 7 |
"""Web search tool that performs searches using the DuckDuckGo search engine.
|