Spaces:
Sleeping
Sleeping
Upload agent
Browse files- agent.json +12 -11
- app.py +4 -3
- requirements.txt +1 -1
- tools/visit_webpage.py +2 -2
agent.json
CHANGED
|
@@ -8,11 +8,12 @@
|
|
| 8 |
"final_answer"
|
| 9 |
],
|
| 10 |
"model": {
|
| 11 |
-
"class": "
|
| 12 |
"data": {
|
| 13 |
-
"last_input_token_count":
|
| 14 |
-
"last_output_token_count":
|
| 15 |
-
"model_id": "
|
|
|
|
| 16 |
}
|
| 17 |
},
|
| 18 |
"managed_agents": {},
|
|
@@ -48,17 +49,17 @@
|
|
| 48 |
"duckduckgo_search"
|
| 49 |
],
|
| 50 |
"authorized_imports": [
|
| 51 |
-
"random",
|
| 52 |
-
"re",
|
| 53 |
-
"queue",
|
| 54 |
"datetime",
|
| 55 |
"itertools",
|
| 56 |
-
"
|
| 57 |
-
"
|
| 58 |
-
"collections",
|
| 59 |
"statistics",
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
"unicodedata",
|
| 61 |
-
"
|
| 62 |
],
|
| 63 |
"executor_type": "local",
|
| 64 |
"executor_kwargs": {},
|
|
|
|
| 8 |
"final_answer"
|
| 9 |
],
|
| 10 |
"model": {
|
| 11 |
+
"class": "LiteLLMModel",
|
| 12 |
"data": {
|
| 13 |
+
"last_input_token_count": 14624,
|
| 14 |
+
"last_output_token_count": 139,
|
| 15 |
+
"model_id": "gemini/gemini-2.0-flash-001",
|
| 16 |
+
"api_base": null
|
| 17 |
}
|
| 18 |
},
|
| 19 |
"managed_agents": {},
|
|
|
|
| 49 |
"duckduckgo_search"
|
| 50 |
],
|
| 51 |
"authorized_imports": [
|
|
|
|
|
|
|
|
|
|
| 52 |
"datetime",
|
| 53 |
"itertools",
|
| 54 |
+
"re",
|
| 55 |
+
"stat",
|
|
|
|
| 56 |
"statistics",
|
| 57 |
+
"time",
|
| 58 |
+
"queue",
|
| 59 |
+
"random",
|
| 60 |
+
"math",
|
| 61 |
"unicodedata",
|
| 62 |
+
"collections"
|
| 63 |
],
|
| 64 |
"executor_type": "local",
|
| 65 |
"executor_kwargs": {},
|
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-001',
|
| 19 |
+
api_base=None,
|
| 20 |
)
|
| 21 |
|
| 22 |
web_search = WebSearch()
|
requirements.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
markdownify
|
| 2 |
requests
|
| 3 |
-
smolagents
|
| 4 |
duckduckgo_search
|
|
|
|
| 1 |
markdownify
|
| 2 |
requests
|
| 3 |
+
smolagents
|
| 4 |
duckduckgo_search
|
tools/visit_webpage.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
from typing import Any, Optional
|
| 2 |
from smolagents.tools import Tool
|
| 3 |
-
import requests
|
| 4 |
-
import smolagents
|
| 5 |
import re
|
| 6 |
import markdownify
|
|
|
|
|
|
|
| 7 |
|
| 8 |
class VisitWebpageTool(Tool):
|
| 9 |
name = "visit_webpage"
|
|
|
|
| 1 |
from typing import Any, Optional
|
| 2 |
from smolagents.tools import Tool
|
|
|
|
|
|
|
| 3 |
import re
|
| 4 |
import markdownify
|
| 5 |
+
import requests
|
| 6 |
+
import smolagents
|
| 7 |
|
| 8 |
class VisitWebpageTool(Tool):
|
| 9 |
name = "visit_webpage"
|