Spaces:
Sleeping
Sleeping
agustin dye
commited on
Commit
·
1c831ec
1
Parent(s):
1d98376
feat: get ammount items
Browse files
app.py
CHANGED
|
@@ -12,14 +12,16 @@ from tools.final_answer import FinalAnswerTool
|
|
| 12 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 13 |
@tool
|
| 14 |
def current_ammount(item: str) -> str:
|
| 15 |
-
# Keep this format for the description / args / args description but feel free to modify the tool
|
| 16 |
"""A tool that returns the current ammount of the item.
|
| 17 |
Args:
|
| 18 |
item: the item you want to know the ammount of
|
| 19 |
"""
|
| 20 |
-
|
|
|
|
| 21 |
|
| 22 |
-
|
|
|
|
|
|
|
| 23 |
|
| 24 |
|
| 25 |
@tool
|
|
|
|
| 12 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 13 |
@tool
|
| 14 |
def current_ammount(item: str) -> str:
|
|
|
|
| 15 |
"""A tool that returns the current ammount of the item.
|
| 16 |
Args:
|
| 17 |
item: the item you want to know the ammount of
|
| 18 |
"""
|
| 19 |
+
try:
|
| 20 |
+
import random
|
| 21 |
|
| 22 |
+
return f"The current ammount of {item} is {random.randint(1, 100)}"
|
| 23 |
+
except Exception as e:
|
| 24 |
+
return f"Error fetching ammount for item '{item}': {str(e)}"
|
| 25 |
|
| 26 |
|
| 27 |
@tool
|