AlfredAgent / tools /final_answer.py
gmansilla's picture
Upload agent
5e5e001 verified
raw
history blame contribute delete
491 Bytes
from typing import Any, Optional
from smolagents.tools import Tool
class FinalAnswerTool(Tool):
name = "final_answer"
description = "Provides a final answer to the given problem."
inputs = {'answer': {'type': 'any', 'description': 'The final answer to the problem'}}
output_type = "any"
def forward(self, answer: Any) -> Any:
return answer
def new_init(self, *args, **kwargs):
original_init(self, *args, **kwargs)
self.validate_arguments()