File size: 332 Bytes
76962bf
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
from langchain_community.tools import DuckDuckGoSearchRun

def search_web(query: str) -> str:
    """Useful for searching the web for medical information or nutritional data."""
    search = DuckDuckGoSearchRun()
    return search.run(query)

# We can also use it as a standalone tool object
web_search_tool = DuckDuckGoSearchRun()