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


class FinalAnswerTool(Tool):
    name = "final_answer"
    description = "Provides the final answer to the user. This can be text or an image."
    
    inputs = {
        "answer": {
            "type": "any",
            "description": "The final answer to the user, which can be text or an image."
        }
    }
    
    output_type = "any"

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

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