Update app.py
Browse files
app.py
CHANGED
|
@@ -5,6 +5,21 @@ import inspect
|
|
| 5 |
import pandas as pd
|
| 6 |
from smolagents import CodeAgent,DuckDuckGoSearchTool, HfApiModel, load_tool, tool
|
| 7 |
from tools.final_answer import FinalAnswerTool
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
# (Keep Constants as is)
|
| 10 |
# --- Constants ---
|
|
|
|
| 5 |
import pandas as pd
|
| 6 |
from smolagents import CodeAgent,DuckDuckGoSearchTool, HfApiModel, load_tool, tool
|
| 7 |
from tools.final_answer import FinalAnswerTool
|
| 8 |
+
from typing import Any, Optional
|
| 9 |
+
from smolagents.tools import Tool
|
| 10 |
+
|
| 11 |
+
class FinalAnswerTool(Tool):
|
| 12 |
+
name = "final_answer"
|
| 13 |
+
description = "Provides a final answer to the given problem."
|
| 14 |
+
inputs = {'answer': {'type': 'any', 'description': 'The final answer to the problem'}}
|
| 15 |
+
output_type = "any"
|
| 16 |
+
|
| 17 |
+
def forward(self, answer: Any) -> Any:
|
| 18 |
+
return answer
|
| 19 |
+
|
| 20 |
+
def __init__(self, *args, **kwargs):
|
| 21 |
+
self.is_initialized = False
|
| 22 |
+
|
| 23 |
|
| 24 |
# (Keep Constants as is)
|
| 25 |
# --- Constants ---
|