c1tr0n75 commited on
Commit
1d7f953
·
verified ·
1 Parent(s): eb1ad6d

adding a final answer tool

Browse files
Files changed (1) hide show
  1. tools.py +13 -1
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