Spaces:
Sleeping
Sleeping
cyberosa
commited on
Commit
·
a1969f6
1
Parent(s):
0373f2f
adjusting final answer tool
Browse files- app.py +3 -3
- tools/final_answer.py +3 -2
app.py
CHANGED
|
@@ -56,13 +56,13 @@ agent = CodeAgent(
|
|
| 56 |
tools=[
|
| 57 |
final_answer,
|
| 58 |
calories_checker,
|
| 59 |
-
],
|
| 60 |
max_steps=6,
|
| 61 |
verbosity_level=1,
|
| 62 |
grammar=None,
|
| 63 |
planning_interval=None,
|
| 64 |
-
name=
|
| 65 |
-
description=
|
| 66 |
prompt_templates=prompt_templates,
|
| 67 |
)
|
| 68 |
|
|
|
|
| 56 |
tools=[
|
| 57 |
final_answer,
|
| 58 |
calories_checker,
|
| 59 |
+
],
|
| 60 |
max_steps=6,
|
| 61 |
verbosity_level=1,
|
| 62 |
grammar=None,
|
| 63 |
planning_interval=None,
|
| 64 |
+
name="NutriCoach",
|
| 65 |
+
description="Agent to help you know more about your food and nutrition",
|
| 66 |
prompt_templates=prompt_templates,
|
| 67 |
)
|
| 68 |
|
tools/final_answer.py
CHANGED
|
@@ -4,16 +4,17 @@ from smolagents.tools import Tool
|
|
| 4 |
|
| 5 |
class FinalAnswerTool(Tool):
|
| 6 |
name = "final_answer"
|
| 7 |
-
description = "Provides a final answer to the given problem."
|
| 8 |
inputs = {
|
| 9 |
"final_answer": {
|
| 10 |
"type": "any",
|
| 11 |
-
"description": "The final answer to the problem",
|
| 12 |
}
|
| 13 |
}
|
| 14 |
output_type = "any"
|
| 15 |
|
| 16 |
def forward(self, final_answer: Any) -> Any:
|
|
|
|
| 17 |
return final_answer
|
| 18 |
|
| 19 |
def __init__(self, *args, **kwargs):
|
|
|
|
| 4 |
|
| 5 |
class FinalAnswerTool(Tool):
|
| 6 |
name = "final_answer"
|
| 7 |
+
description = "Provides a final answer to the given problem. Uses the nutritional information from calories_check tool to give an advice as a professional nutritionist."
|
| 8 |
inputs = {
|
| 9 |
"final_answer": {
|
| 10 |
"type": "any",
|
| 11 |
+
"description": "The final answer to the problem and a final advice.",
|
| 12 |
}
|
| 13 |
}
|
| 14 |
output_type = "any"
|
| 15 |
|
| 16 |
def forward(self, final_answer: Any) -> Any:
|
| 17 |
+
|
| 18 |
return final_answer
|
| 19 |
|
| 20 |
def __init__(self, *args, **kwargs):
|