File size: 513 Bytes
8fe992b
 
 
 
 
 
3fd8f47
 
 
 
 
 
 
 
 
 
8fe992b
 
 
3fd8f47
8fe992b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from smolagents.tools import Tool

class FinalAnswerTool(Tool):
    name = "final_answer"
    description = "Provides a final answer to the given problem."

    inputs = {
        "answer": {
            "type": "string",
            "description": "The final answer to the problem"
        }
    }

    output_type = "string"

    def forward(self, answer: str) -> str:
        return answer

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.is_initialized = False