kalekarnn commited on
Commit
136768d
·
verified ·
1 Parent(s): ea54376

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -9,13 +9,17 @@ from Gradio_UI import GradioUI
9
 
10
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
11
  @tool
12
- def stock_price(arg1:str)-> str:
13
  """A tool that search the current stock price of the specified company
14
  Args:
15
- arg1: A string representing a name of the company whose stock price needs to be searched.
16
  """
17
- result = DuckDuckGoSearchTool(str)
18
- return result
 
 
 
 
19
 
20
  @tool
21
  def get_current_time_in_timezone(timezone: str) -> str:
 
9
 
10
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
11
  @tool
12
+ def stock_price(company_name:str)-> str:
13
  """A tool that search the current stock price of the specified company
14
  Args:
15
+ company_name: A string representing a name of the company whose stock price needs to be searched.
16
  """
17
+ try:
18
+ tool = DuckDuckGoSearchTool()
19
+ result = tool(company_name)
20
+ return result
21
+ except Exception as e:
22
+ return f"Error fetching stock price for company '{timezone}'"
23
 
24
  @tool
25
  def get_current_time_in_timezone(timezone: str) -> str: