Atom / src /tools.py
Abraham E. Tavarez
Search tool created
8ff02f0
raw
history blame contribute delete
378 Bytes
from langchain_community.tools import DuckDuckGoSearchResults
from state import AgentState
def search_tool(state: AgentState) -> str:
"""Search the internet for the given question"""
print('\n STATE:', state)
question = state["question"]
search = DuckDuckGoSearchResults()
search_results = search.invoke(question)
return {"final_answer": search_results}