bobobert4 commited on
Commit
b351c59
·
verified ·
1 Parent(s): 98e1bf6

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +3 -4
agent.py CHANGED
@@ -13,7 +13,7 @@ from langchain_google_genai import ChatGoogleGenerativeAI
13
  from smolagents import CodeAgent, HfApiModel
14
 
15
  # Import our custom tools from their modules
16
- from tools import search_tool
17
 
18
  # HF Chat interface
19
  # llm = HuggingFaceEndpoint(
@@ -29,8 +29,7 @@ chat = ChatGoogleGenerativeAI(
29
  max_retries=2,
30
  )
31
 
32
- tools = [search_tool]
33
- chat_with_tools = chat.bind_tools(tools)
34
  memory = MemorySaver()
35
 
36
  # Generate the AgentState and Agent graph
@@ -47,7 +46,7 @@ builder = StateGraph(AgentState)
47
 
48
  # Define nodes: these do the work
49
  builder.add_node("assistant", assistant)
50
- builder.add_node("tools", ToolNode(tools))
51
 
52
  # Define edges: these determine how the control flow moves
53
  builder.add_edge(START, "assistant")
 
13
  from smolagents import CodeAgent, HfApiModel
14
 
15
  # Import our custom tools from their modules
16
+ from tools import basic_tools
17
 
18
  # HF Chat interface
19
  # llm = HuggingFaceEndpoint(
 
29
  max_retries=2,
30
  )
31
 
32
+ chat_with_tools = chat.bind_tools(basic_tools)
 
33
  memory = MemorySaver()
34
 
35
  # Generate the AgentState and Agent graph
 
46
 
47
  # Define nodes: these do the work
48
  builder.add_node("assistant", assistant)
49
+ builder.add_node("tools", ToolNode(basic_tools))
50
 
51
  # Define edges: these determine how the control flow moves
52
  builder.add_edge(START, "assistant")