statefulChatbot / src /tools /search_tool.py
shubhamchau222
graph nodes and llm functionality added
71a4d85
raw
history blame contribute delete
396 Bytes
from langchain_community.tools.tavily_search import TavilySearchResults
from langgraph.prebuilt import ToolNode
def get_tools():
"""
Return the list of tools to be used in the chatbot
"""
tools=[TavilySearchResults(max_results=2)]
return tools
def create_tool_node(tools):
"""
creates and returns a tool node for the graph
"""
return ToolNode(tools=tools)