Spaces:
Sleeping
Sleeping
adding a final answer tool
Browse files
tools.py
CHANGED
|
@@ -42,4 +42,16 @@ class VisitWebpageTool(Tool):
|
|
| 42 |
return f"An unexpected error occurred: {str(e)}"
|
| 43 |
|
| 44 |
def __init__(self, *args, **kwargs):
|
| 45 |
-
self.is_initialized = False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
return f"An unexpected error occurred: {str(e)}"
|
| 43 |
|
| 44 |
def __init__(self, *args, **kwargs):
|
| 45 |
+
self.is_initialized = False
|
| 46 |
+
|
| 47 |
+
class FinalAnswerTool(Tool):
|
| 48 |
+
name = "final_answer"
|
| 49 |
+
description = "Provides a final answer to the given problem."
|
| 50 |
+
inputs = {'answer': {'type': 'any', 'description': 'The final answer to the problem'}}
|
| 51 |
+
output_type = "any"
|
| 52 |
+
|
| 53 |
+
def forward(self, answer: Any) -> Any:
|
| 54 |
+
return answer
|
| 55 |
+
|
| 56 |
+
def __init__(self, *args, **kwargs):
|
| 57 |
+
self.is_initialized = False
|