Spaces:
Build error
Build error
Download search_agent.py from RohitKeswani/react_agent: direct link, hf CLI and curl.
- Browser
- Download file 406 Bytes
-
https://huggingface.co/spaces/RohitKeswani/react_agent/resolve/main/search_agent.py
- Command line
-
hf download hf://spaces/RohitKeswani/react_agent/search_agent.py
-
curl -L -o search_agent.py https://huggingface.co/spaces/RohitKeswani/react_agent/resolve/main/search_agent.py
406 Bytes
| from typing import Literal | |
| from langchain_core.tools import tool | |
| from langchain_community.tools import DuckDuckGoSearchRun | |
| def get_search_results(query: str) -> str: | |
| """Fetches search results from DuckDuckGo.""" | |
| # Perform the search using DuckDuckGoSearchRun | |
| search_tool = DuckDuckGoSearchRun() | |
| results = search_tool.invoke(query) | |
| return results | |
| tools = [get_search_results] |