mo-ali-nlp commited on
Commit
6be8b61
·
verified ·
1 Parent(s): d49af24

Update app.py

Browse files

modified docstring, maybe it will work

Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -19,19 +19,19 @@ def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return
19
  return "What magic will you build ?"
20
 
21
  @tool
22
- def get_news_headlines(headlines: str)-> str:
23
- """A tool that fetches the most recent headlines
24
  Args:
25
- headlines: A string representing the latest news headlines
26
  """
27
  try:
28
  hl = DuckDuckGoSearchTool()
29
  results = hl.run(f"{headlines} news")
30
- return f"The current news headlines are {results}"
31
  except Exception as e:
32
  import traceback
33
  traceback.print_exc() # dumps full stack to your logs
34
- return f"Error fetching news headlines: {e}"
35
 
36
  @tool
37
  def get_current_time_in_timezone(timezone: str) -> str:
 
19
  return "What magic will you build ?"
20
 
21
  @tool
22
+ def get_news_headlines(headlines: str) -> str:
23
+ """A tool that fetches the three most recent headlines from the news.
24
  Args:
25
+ headlines: A string representing the latest three news headlines.
26
  """
27
  try:
28
  hl = DuckDuckGoSearchTool()
29
  results = hl.run(f"{headlines} news")
30
+ return f"The three most recent news headlines from the news are {results}."
31
  except Exception as e:
32
  import traceback
33
  traceback.print_exc() # dumps full stack to your logs
34
+ return f"Error fetching the news headlines: {e}."
35
 
36
  @tool
37
  def get_current_time_in_timezone(timezone: str) -> str: