Vaib9 commited on
Commit
625b69e
·
verified ·
1 Parent(s): 9596467

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
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 web_search_tool(query:str)-> str: #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 query and performs a web search on it.
16
  Args:
17
- query: A string representing a search query from user.
18
  """
19
  try:
20
- # Create a search object
21
- answer = DuckDuckGoSearchTool(query)
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, web_search_tool, image_generation_tool], ## add your tools here (don't remove 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,