Final_Assignment_Template01 / final_answer.py
Karim0111's picture
Update final_answer.py
c837b15 verified
from typing import Any
from smolagents.tools import Tool
class FinalAnswerTool(Tool):
name = "final_answer"
description = "Used to submit the final answer to the problem."
inputs = {'answer': {'type': 'any', 'description': 'The final answer to the problem'}}
output_type = "any"
def forward(self, answer: Any) -> Any:
return answer
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.is_initialized = True