Spaces:
Sleeping
Sleeping
| 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} |