Spaces:
Sleeping
Sleeping
Update tools/FinalAnswerTool.py
Browse files- tools/FinalAnswerTool.py +11 -7
tools/FinalAnswerTool.py
CHANGED
|
@@ -11,13 +11,17 @@ print(settings.llm_model_id)
|
|
| 11 |
class FinalAnswerTool(Tool):
|
| 12 |
name = "final_answer"
|
| 13 |
description = """
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
output_type = "string"
|
| 22 |
|
| 23 |
def forward(self, answer: str) -> str:
|
|
|
|
| 11 |
class FinalAnswerTool(Tool):
|
| 12 |
name = "final_answer"
|
| 13 |
description = """
|
| 14 |
+
Takes the agent's computed result and formats the final answer.
|
| 15 |
+
|
| 16 |
+
If the question asks to express time in 'thousands of hours', divide the total hours by 1000,
|
| 17 |
+
round to the nearest integer, and return ONLY that integer with no extra text.
|
| 18 |
+
|
| 19 |
+
Output only the final answer as a clean string — no explanation, no labels, no formatting.
|
| 20 |
+
"""
|
| 21 |
+
inputs = {
|
| 22 |
+
"answer": {"type": "string", "description": "The final, correctly formatted answer string."}
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
output_type = "string"
|
| 26 |
|
| 27 |
def forward(self, answer: str) -> str:
|