Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,25 +9,18 @@ from Gradio_UI import GradioUI
|
|
| 9 |
|
| 10 |
|
| 11 |
@tool
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
raise TypeError("Both inputs must be integers")
|
| 25 |
-
|
| 26 |
-
try:
|
| 27 |
-
res = num1 + num2
|
| 28 |
-
return f"The sum of two integers is: {res}"
|
| 29 |
-
except Exception as e:
|
| 30 |
-
return f"An error occurred: {str(e)}"
|
| 31 |
|
| 32 |
|
| 33 |
@tool
|
|
|
|
| 9 |
|
| 10 |
|
| 11 |
@tool
|
| 12 |
+
{
|
| 13 |
+
"name": "sum_tool",
|
| 14 |
+
"type": "Code",
|
| 15 |
+
"function": "calculate",
|
| 16 |
+
"input_parameters": {
|
| 17 |
+
"math_expression": "string"
|
| 18 |
+
},
|
| 19 |
+
"output": {
|
| 20 |
+
"result": "number"
|
| 21 |
+
},
|
| 22 |
+
"code": "return eval(math_expression)"
|
| 23 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
|
| 26 |
@tool
|