File size: 721 Bytes
04da702
8fe992b
 
 
 
41558f1
 
 
 
 
8fe992b
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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'}}
    description = "Provides a final answer or result for the question or request. You do not need to tell the user that the task is complete, simply return the result."
    inputs = {'answer': {'type': 'any', 'description': 'An image, audio tensor or text response'}}

    output_type = "any"

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

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