fix
Browse files
app.py
CHANGED
@@ -14,7 +14,14 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
14 |
# --- Tool Definitions ---
|
15 |
@tool
|
16 |
def calculator(expression: str) -> str:
|
17 |
-
"""Calculate mathematical expressions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
try:
|
19 |
return str(eval(expression))
|
20 |
except Exception as e:
|
@@ -22,7 +29,14 @@ def calculator(expression: str) -> str:
|
|
22 |
|
23 |
@tool
|
24 |
def reverse_text(text: str) -> str:
|
25 |
-
"""Reverse text (for handling backwards text questions)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
return text[::-1]
|
27 |
|
28 |
# --- GAIA Agent Implementation ---
|
|
|
14 |
# --- Tool Definitions ---
|
15 |
@tool
|
16 |
def calculator(expression: str) -> str:
|
17 |
+
"""Calculate mathematical expressions
|
18 |
+
|
19 |
+
Args:
|
20 |
+
expression: The mathematical expression to evaluate as a string
|
21 |
+
|
22 |
+
Returns:
|
23 |
+
The result of the calculation as a string
|
24 |
+
"""
|
25 |
try:
|
26 |
return str(eval(expression))
|
27 |
except Exception as e:
|
|
|
29 |
|
30 |
@tool
|
31 |
def reverse_text(text: str) -> str:
|
32 |
+
"""Reverse text (for handling backwards text questions)
|
33 |
+
|
34 |
+
Args:
|
35 |
+
text: The text to reverse
|
36 |
+
|
37 |
+
Returns:
|
38 |
+
The reversed text
|
39 |
+
"""
|
40 |
return text[::-1]
|
41 |
|
42 |
# --- GAIA Agent Implementation ---
|