SmartWebAnalyzerPlus / tools /final_answer.py
MHamdan's picture
Initial commit with full functionality extend app req tools
ba25b4b
raw
history blame
449 Bytes
# tools/final_answer.py
from typing import Any
from smolagents import tool
@tool
class FinalAnswerTool:
name = "final_answer" # Required by smolagents
description = "A tool to provide the final answer"
def __call__(self, answer: str) -> str:
"""Tool to provide a final answer
Args:
answer: The final answer to return
"""
return answer
def __str__(self) -> str:
return self.name