Spaces:
Sleeping
Sleeping
Add required inputs attribute to all Tool classes for smolagents 1.9.2 compatibility
Browse files- tools/final_answer.py +6 -0
- tools/search.py +6 -0
- tools/weather.py +6 -0
tools/final_answer.py
CHANGED
|
@@ -6,6 +6,12 @@ class FinalAnswerTool(Tool):
|
|
| 6 |
|
| 7 |
name = "final_answer"
|
| 8 |
description = "Use this tool to provide your final answer to the user's question."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
def __call__(self, answer: str) -> str:
|
| 11 |
"""
|
|
|
|
| 6 |
|
| 7 |
name = "final_answer"
|
| 8 |
description = "Use this tool to provide your final answer to the user's question."
|
| 9 |
+
inputs = {
|
| 10 |
+
"answer": {
|
| 11 |
+
"type": "string",
|
| 12 |
+
"description": "The final answer to provide to the user."
|
| 13 |
+
}
|
| 14 |
+
}
|
| 15 |
|
| 16 |
def __call__(self, answer: str) -> str:
|
| 17 |
"""
|
tools/search.py
CHANGED
|
@@ -8,6 +8,12 @@ class DuckDuckGoSearchTool(Tool):
|
|
| 8 |
|
| 9 |
name = "duck_duck_go_search"
|
| 10 |
description = "Search the web for information using DuckDuckGo."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
def __call__(self, query: str) -> str:
|
| 13 |
"""
|
|
|
|
| 8 |
|
| 9 |
name = "duck_duck_go_search"
|
| 10 |
description = "Search the web for information using DuckDuckGo."
|
| 11 |
+
inputs = {
|
| 12 |
+
"query": {
|
| 13 |
+
"type": "string",
|
| 14 |
+
"description": "A string representing the search query."
|
| 15 |
+
}
|
| 16 |
+
}
|
| 17 |
|
| 18 |
def __call__(self, query: str) -> str:
|
| 19 |
"""
|
tools/weather.py
CHANGED
|
@@ -7,6 +7,12 @@ class WeatherTool(Tool):
|
|
| 7 |
|
| 8 |
name = "get_weather"
|
| 9 |
description = "Get the current weather for a specified location."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
def __call__(self, location: str) -> str:
|
| 12 |
"""
|
|
|
|
| 7 |
|
| 8 |
name = "get_weather"
|
| 9 |
description = "Get the current weather for a specified location."
|
| 10 |
+
inputs = {
|
| 11 |
+
"location": {
|
| 12 |
+
"type": "string",
|
| 13 |
+
"description": "A string representing a city or location (e.g., 'New York', 'Paris, France')."
|
| 14 |
+
}
|
| 15 |
+
}
|
| 16 |
|
| 17 |
def __call__(self, location: str) -> str:
|
| 18 |
"""
|