File size: 960 Bytes
fe8bf03
8fe992b
fe8bf03
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4a671bb
 
 
 
 
 
 
fe8bf03
4a671bb
fe8bf03
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from typing import Optional

class FinalAnswerTool:
    """A tool that allows the agent to provide a final answer to the user's query."""
    
    def __call__(self, answer: str) -> str:
        """Provide a final answer to the user's query.
        
        Args:
            answer: The final answer to provide to the user.
            
        Returns:
            A confirmation message.
        """
        return f"FINAL ANSWER: {answer}"
    
    def __str__(self) -> str:
        return "final_answer"
    
    @property
    def name(self) -> str:
        return "final_answer"
    
    @property
    def description(self) -> str:
        return "Use this tool to provide a final answer to the user's query."
    
    @property
    def signature(self) -> str:
        return "final_answer(answer: str) -> str"
    
    def argument_descriptions(self) -> dict:
        return {
            "answer": "The final answer to provide to the user."
        }