amatsarski commited on
Commit
313a9d2
·
verified ·
1 Parent(s): 4aa9d41

Update agents/tools.py

Browse files
Files changed (1) hide show
  1. agents/tools.py +4 -0
agents/tools.py CHANGED
@@ -1,4 +1,8 @@
1
  from langchain.tools import tool
 
 
 
 
2
 
3
  @tool("search_news", return_direct=False)
4
  def search_news_tool(query: str, max_results: int = 5) -> str:
 
1
  from langchain.tools import tool
2
+ try:
3
+ from duckduckgo_search import DDGS
4
+ except Exception:
5
+ DDGS = None # optional; handle gracefully below
6
 
7
  @tool("search_news", return_direct=False)
8
  def search_news_tool(query: str, max_results: int = 5) -> str: