Update app.py
#344
by
ananyaagnihotri
- opened
app.py
CHANGED
@@ -16,6 +16,14 @@ def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return
|
|
16 |
arg1: the first argument
|
17 |
arg2: the second argument
|
18 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
return "What magic will you build ?"
|
20 |
|
21 |
@tool
|
|
|
16 |
arg1: the first argument
|
17 |
arg2: the second argument
|
18 |
"""
|
19 |
+
if arg1 == "square":
|
20 |
+
return f"The square of {arg2} is {arg2 ** 2}"
|
21 |
+
elif arg1 == "double":
|
22 |
+
return f"The double of {arg2} is {arg2 * 2}"
|
23 |
+
elif arg1 == "triple":
|
24 |
+
return f"The triple of {arg2} is {arg2 * 3}"
|
25 |
+
else:
|
26 |
+
return "Unknown operation. Try 'square', 'double', or 'triple'."
|
27 |
return "What magic will you build ?"
|
28 |
|
29 |
@tool
|