Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
# app.py
|
| 2 |
-
from smolagents import CodeAgent, HfApiModel,
|
| 3 |
from tools.final_answer import FinalAnswerTool
|
| 4 |
from tools.web_search import DuckDuckGoSearchTool # 👈 ajout
|
| 5 |
from tools.visit_webpage import VisitWebpageTool # 👈 ajout
|
|
@@ -23,12 +23,12 @@ agent = CodeAgent(
|
|
| 23 |
)
|
| 24 |
|
| 25 |
# Exemple d'outils custom existants
|
| 26 |
-
@
|
| 27 |
def my_custom_tool() -> str:
|
| 28 |
"""This is a custom tool."""
|
| 29 |
return "This is my custom tool!"
|
| 30 |
|
| 31 |
-
@
|
| 32 |
def get_current_time_in_timezone(timezone: str) -> str:
|
| 33 |
"""Get the current time in a given timezone."""
|
| 34 |
from datetime import datetime
|
|
|
|
| 1 |
# app.py
|
| 2 |
+
from smolagents import CodeAgent, HfApiModel, Tool
|
| 3 |
from tools.final_answer import FinalAnswerTool
|
| 4 |
from tools.web_search import DuckDuckGoSearchTool # 👈 ajout
|
| 5 |
from tools.visit_webpage import VisitWebpageTool # 👈 ajout
|
|
|
|
| 23 |
)
|
| 24 |
|
| 25 |
# Exemple d'outils custom existants
|
| 26 |
+
@Tool
|
| 27 |
def my_custom_tool() -> str:
|
| 28 |
"""This is a custom tool."""
|
| 29 |
return "This is my custom tool!"
|
| 30 |
|
| 31 |
+
@Tool
|
| 32 |
def get_current_time_in_timezone(timezone: str) -> str:
|
| 33 |
"""Get the current time in a given timezone."""
|
| 34 |
from datetime import datetime
|