CoolFace
Apppublic

Compete2/testspace

sourceHugging Facemitupdated 2y agoView on Hugging Face
0likes
final_answer.py15 linesDownload Raw Back to tools
1from typing import Any, Optional2from smolagents.tools import Tool3 4class FinalAnswerTool(Tool):5    name = "final_answer"6    description = "Provides a final answer to the given problem."7    inputs = {'answer': {'type': 'any', 'description': 'The final answer to the problem'}}8    output_type = "any"9 10    def forward(self, answer: Any) -> Any:11        return answer12 13    def __init__(self, *args, **kwargs):14        self.is_initialized = False15