Spaces:
Sleeping
Sleeping
Initial commit with full functionality extend app req tools
Browse files- tools/final_answer.py +9 -3
tools/final_answer.py
CHANGED
@@ -11,7 +11,7 @@ class FinalAnswerTool(Tool):
|
|
11 |
# Define inputs with the correct type string
|
12 |
inputs: Dict[str, Any] = {
|
13 |
"answer": {
|
14 |
-
"type": "string",
|
15 |
"description": "The final answer to be returned"
|
16 |
}
|
17 |
}
|
@@ -23,11 +23,17 @@ class FinalAnswerTool(Tool):
|
|
23 |
super().__init__()
|
24 |
self.description = description or self.description
|
25 |
|
26 |
-
def
|
27 |
"""Process and return the final answer.
|
|
|
28 |
Args:
|
29 |
answer: The answer text to be returned
|
|
|
30 |
Returns:
|
31 |
str: The processed answer
|
32 |
"""
|
33 |
-
return answer
|
|
|
|
|
|
|
|
|
|
11 |
# Define inputs with the correct type string
|
12 |
inputs: Dict[str, Any] = {
|
13 |
"answer": {
|
14 |
+
"type": "string",
|
15 |
"description": "The final answer to be returned"
|
16 |
}
|
17 |
}
|
|
|
23 |
super().__init__()
|
24 |
self.description = description or self.description
|
25 |
|
26 |
+
def forward(self, answer: str) -> str:
|
27 |
"""Process and return the final answer.
|
28 |
+
|
29 |
Args:
|
30 |
answer: The answer text to be returned
|
31 |
+
|
32 |
Returns:
|
33 |
str: The processed answer
|
34 |
"""
|
35 |
+
return answer
|
36 |
+
|
37 |
+
def __call__(self, answer: str) -> str:
|
38 |
+
"""Alias for forward method to maintain compatibility"""
|
39 |
+
return self.forward(answer)
|