test_agent_push_to_hub / tools /final_answer.py
ysharma's picture
ysharma HF staff
Upload agent
0e78aa3 verified
raw
history blame
448 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 __init__(self, *args, **kwargs):
self.is_initialized = False