Scott Cogan commited on
Commit
cd7d021
·
1 Parent(s): 81e323c

langchain versions

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -8,7 +8,7 @@ from langchain_google_genai import ChatGoogleGenerativeAI
8
  from typing import IO, Dict
9
  from io import BytesIO
10
  from langchain_core.messages import HumanMessage, SystemMessage
11
- from langgraph.graph import MessagesState, START, StateGraph
12
  from langgraph.prebuilt import tools_condition
13
  from langgraph.prebuilt import ToolNode
14
  import base64
@@ -198,7 +198,7 @@ class BasicAgent:
198
  ''')
199
 
200
  # Graph
201
- self.builder = StateGraph(MessagesState)
202
 
203
  # Define nodes: these do the work
204
  self.builder.add_node("assistant", self.assistant)
@@ -217,7 +217,7 @@ class BasicAgent:
217
 
218
  print("BasicAgent initialized.")
219
 
220
- def assistant(self, state: MessagesState):
221
  return {"messages": [self.agent.invoke([self.sys_msg] + state["messages"])]}
222
 
223
  async def __call__(self, question: str, task_id: str) -> str:
 
8
  from typing import IO, Dict
9
  from io import BytesIO
10
  from langchain_core.messages import HumanMessage, SystemMessage
11
+ from langgraph.graph import START, StateGraph
12
  from langgraph.prebuilt import tools_condition
13
  from langgraph.prebuilt import ToolNode
14
  import base64
 
198
  ''')
199
 
200
  # Graph
201
+ self.builder = StateGraph(START)
202
 
203
  # Define nodes: these do the work
204
  self.builder.add_node("assistant", self.assistant)
 
217
 
218
  print("BasicAgent initialized.")
219
 
220
+ def assistant(self, state: StateGraph):
221
  return {"messages": [self.agent.invoke([self.sys_msg] + state["messages"])]}
222
 
223
  async def __call__(self, question: str, task_id: str) -> str: