File size: 789 Bytes
6fe4093
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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)

def get_tools_by_usecase(usecase):
    """
    Return tools based on the specific use case
    """
    if usecase == "Chatbot with Web Search":
        return get_tools()
    elif usecase == "Research Assistant":
        from .arxiv_tool import get_research_assistant_tools
        return get_research_assistant_tools()
    else:
        # Default to web search tools
        return get_tools()