Spaces:
Sleeping
Sleeping
# tools/final_answer.py | |
from dataclasses import dataclass, field | |
class FinalAnswerTool: | |
"""A tool to format and deliver the final answer to the user.""" | |
name: str = field(default="final_answer", init=False) | |
description: str = field(default="Tool to provide the final answer", init=False) | |
def __call__(self, answer: str) -> str: | |
"""Process and return the final response. | |
Args: | |
answer: The final answer text to return to the user. | |
Returns: | |
The processed answer as a string. | |
""" | |
return answer | |
def __str__(self) -> str: | |
return self.name |