Update app.py
Browse files
app.py
CHANGED
|
@@ -8,21 +8,6 @@ from smolagents import CodeAgent,DuckDuckGoSearchTool, HfApiModel, load_tool, to
|
|
| 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 |
-
@tool
|
| 24 |
-
final_answer = FinalAnswerTool()
|
| 25 |
-
|
| 26 |
# (Keep Constants as is)
|
| 27 |
# --- Constants ---
|
| 28 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
|
|
| 8 |
from typing import Any, Optional
|
| 9 |
from smolagents.tools import Tool
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
# (Keep Constants as is)
|
| 12 |
# --- Constants ---
|
| 13 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|