Spaces:
Sleeping
Sleeping
Initial commit with full functionality extend app req tools
Browse files- tools/final_answer.py +5 -6
tools/final_answer.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
# tools/final_answer.py
|
| 2 |
from smolagents import Tool
|
| 3 |
-
from typing import Optional,
|
| 4 |
|
| 5 |
class FinalAnswerTool(Tool):
|
| 6 |
"""Tool for providing final answers to user queries."""
|
|
@@ -8,14 +8,13 @@ class FinalAnswerTool(Tool):
|
|
| 8 |
name = "final_answer"
|
| 9 |
description = "Tool for providing the final answer to the agent's task"
|
| 10 |
|
| 11 |
-
# Define inputs as a class attribute
|
| 12 |
-
inputs:
|
| 13 |
-
{
|
| 14 |
-
"name": "answer",
|
| 15 |
"type": "str",
|
| 16 |
"description": "The final answer to be returned"
|
| 17 |
}
|
| 18 |
-
|
| 19 |
|
| 20 |
def __init__(self, description: Optional[str] = None):
|
| 21 |
super().__init__()
|
|
|
|
| 1 |
# tools/final_answer.py
|
| 2 |
from smolagents import Tool
|
| 3 |
+
from typing import Optional, Dict, Any
|
| 4 |
|
| 5 |
class FinalAnswerTool(Tool):
|
| 6 |
"""Tool for providing final answers to user queries."""
|
|
|
|
| 8 |
name = "final_answer"
|
| 9 |
description = "Tool for providing the final answer to the agent's task"
|
| 10 |
|
| 11 |
+
# Define inputs as a class attribute (now a dictionary)
|
| 12 |
+
inputs: Dict[str, Any] = {
|
| 13 |
+
"answer": {
|
|
|
|
| 14 |
"type": "str",
|
| 15 |
"description": "The final answer to be returned"
|
| 16 |
}
|
| 17 |
+
}
|
| 18 |
|
| 19 |
def __init__(self, description: Optional[str] = None):
|
| 20 |
super().__init__()
|