First_agent_template / tools /final_answer.py
cyberosa
trying to fix the error
bee9023
raw
history blame
516 Bytes
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 = {
"final_answer": {
"type": "any",
"description": "The final answer to the problem",
}
}
output_type = "any"
def forward(self, final_answer: Any) -> Any:
return final_answer
def __init__(self, *args, **kwargs):
self.is_initialized = False