Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,17 +10,20 @@ from Gradio_UI import GradioUI
|
|
| 10 |
|
| 11 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 12 |
@tool
|
| 13 |
-
def compute_derivative(expr_str:str, var_str: str = 'x')-> str:
|
| 14 |
-
|
| 15 |
-
|
|
|
|
| 16 |
Args:
|
| 17 |
-
|
| 18 |
-
|
|
|
|
| 19 |
"""
|
| 20 |
var = symbols(var_str)
|
| 21 |
expr = sympify(expr_str)
|
| 22 |
derivative = diff(expr, var)
|
| 23 |
-
return derivative
|
|
|
|
| 24 |
|
| 25 |
@tool
|
| 26 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
|
| 10 |
|
| 11 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 12 |
@tool
|
| 13 |
+
def compute_derivative(expr_str: str, var_str: str = 'x') -> str:
|
| 14 |
+
"""
|
| 15 |
+
A tool that computes the symbolic derivative of an expression.
|
| 16 |
+
|
| 17 |
Args:
|
| 18 |
+
expr_str (str): A string representing the expression (e.g., "x**2 + sin(x)").
|
| 19 |
+
var_str (str): The variable with respect to which to differentiate (default: "x").
|
| 20 |
+
|
| 21 |
"""
|
| 22 |
var = symbols(var_str)
|
| 23 |
expr = sympify(expr_str)
|
| 24 |
derivative = diff(expr, var)
|
| 25 |
+
return str(derivative)
|
| 26 |
+
|
| 27 |
|
| 28 |
@tool
|
| 29 |
def get_current_time_in_timezone(timezone: str) -> str:
|