supratipb commited on
Commit
3760450
Β·
verified Β·
1 Parent(s): 8b49706

Upload agent.py

Browse files
Files changed (1) hide show
  1. agent.py +4 -3
agent.py CHANGED
@@ -279,7 +279,7 @@ tools = [
279
  ]
280
 
281
  # Build graph function
282
- def build_graph(provider: str = "groq"):
283
  """Build the graph"""
284
  # Load environment variables from .env file
285
  if provider == "openai":
@@ -307,8 +307,9 @@ def build_graph(provider: str = "groq"):
307
 
308
  # Node
309
  def assistant(state: MessagesState):
310
- """Assistant node"""
311
- return {"messages": [llm_with_tools.invoke(state["messages"])]}
 
312
 
313
  def retriever(state: MessagesState):
314
  """Retriever node"""
 
279
  ]
280
 
281
  # Build graph function
282
+ def build_graph(provider: str = "anthropic"):
283
  """Build the graph"""
284
  # Load environment variables from .env file
285
  if provider == "openai":
 
307
 
308
  # Node
309
  def assistant(state: MessagesState):
310
+ messages_with_sys = [sys_msg] + state["messages"]
311
+ return {"messages": [llm_with_tools.invoke(messages_with_sys)]}
312
+
313
 
314
  def retriever(state: MessagesState):
315
  """Retriever node"""