TheRealNeil commited on
Commit
6eba67b
·
verified ·
1 Parent(s): b0b108b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -16,7 +16,8 @@ def get_stock_price(company:str)-> str: #it's import to specify the return type
16
  arg1: the ticker of the requested stock price
17
  """
18
  try:
19
- price = DuckDuckGoSearchTool("'{company}' stock price")
 
20
  return f"The current price for '{company}' is '{price}'"
21
  except Exception as e:
22
  return f"Error fetching the stock price for '{company}': {str(e)}"
 
16
  arg1: the ticker of the requested stock price
17
  """
18
  try:
19
+ web_search_tool = DuckDuckGoSearchTool(max_results=5, rate_limit=2.0)
20
+ results = web_search_tool(f"'{company}' stock price")
21
  return f"The current price for '{company}' is '{price}'"
22
  except Exception as e:
23
  return f"Error fetching the stock price for '{company}': {str(e)}"