Saketh1121 commited on
Commit
01615a4
·
verified ·
1 Parent(s): 5f632ce

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -16,8 +16,8 @@ def get_weather(city:str)-> str: #it's import to specify the return type
16
  city: Name of the city
17
  """
18
  try:
19
- search = DuckDuckGoSearchTool()
20
- result = search("Weather in " + city)
21
  return f"Weather in {city} is {result}"
22
  except Exception as e:
23
  return f"Error fetching weather for {city}: {str(e)}"
 
16
  city: Name of the city
17
  """
18
  try:
19
+ search = DuckDuckGoSearchTool(max_results=5, rate_limit=2.0)
20
+ result = search(query=f"Weather in {city}")
21
  return f"Weather in {city} is {result}"
22
  except Exception as e:
23
  return f"Error fetching weather for {city}: {str(e)}"