crypto_crewAI / tools /.ipynb_checkpoints /search_duckduckgo_tool-checkpoint.py
quocdat25's picture
Upload folder using huggingface_hub
d9b1770 verified
from crewai_tools import BaseTool
from langchain_community.tools import DuckDuckGoSearchRun
class SearchDuckDuckGo(BaseTool):
name: str = "SearchDuckDuckGo"
description: str = "use DuckDuckGo to fetch some news"
def _run(self, question: str) -> str:
search = DuckDuckGoSearchRun()
result = search.run(question)
return result