Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -10,15 +10,15 @@ from Gradio_UI import GradioUI
|
|
10 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
11 |
|
12 |
@tool
|
13 |
-
def
|
14 |
# Keep this format for the description / args / args description but feel free to modify the tool
|
15 |
-
"""A tool that takes user's
|
16 |
Args:
|
17 |
-
|
18 |
"""
|
19 |
try:
|
20 |
-
|
21 |
-
answer =
|
22 |
return answer
|
23 |
except Exception as e:
|
24 |
return f"Error fetching the search query."
|
@@ -60,7 +60,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
60 |
|
61 |
agent = CodeAgent(
|
62 |
model=model,
|
63 |
-
tools=[final_answer,
|
64 |
max_steps=6,
|
65 |
verbosity_level=1,
|
66 |
grammar=None,
|
|
|
10 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
11 |
|
12 |
@tool
|
13 |
+
def calculator_tool(numbers:float)-> float: #it's import to specify the return type
|
14 |
# Keep this format for the description / args / args description but feel free to modify the tool
|
15 |
+
"""A tool that takes user's numbers and performs calculations.
|
16 |
Args:
|
17 |
+
numbers: A numbers input for calculation from the user.
|
18 |
"""
|
19 |
try:
|
20 |
+
url = "https://www.desmos.com/api/v1.10/calculator.js?apiKey=dcb31709b452b1cf9dc26972add0fda6"
|
21 |
+
answer = url(numbers)
|
22 |
return answer
|
23 |
except Exception as e:
|
24 |
return f"Error fetching the search query."
|
|
|
60 |
|
61 |
agent = CodeAgent(
|
62 |
model=model,
|
63 |
+
tools=[final_answer, calculator_tool_tool, image_generation_tool], ## add your tools here (don't remove final answer)
|
64 |
max_steps=6,
|
65 |
verbosity_level=1,
|
66 |
grammar=None,
|