sunnyday910 commited on
Commit
714e7b7
·
verified ·
1 Parent(s): aa3b4bf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -33,9 +33,9 @@ class BasicAgent:
33
  print("BasicAgent initialized.")
34
  def __call__(self, question: str) -> str:
35
  print(f"Agent received question (first 50 chars): {question[:50]}...")
36
- input_state = {"question": question}
37
- # Run the graph
38
- answer = self.graph.invoke(input_state)
39
  print(f"Agent returning fixed answer: {answer}")
40
  return answer
41
 
 
33
  print("BasicAgent initialized.")
34
  def __call__(self, question: str) -> str:
35
  print(f"Agent received question (first 50 chars): {question[:50]}...")
36
+ messages = [HumanMessage(content=question)]
37
+ messages = self.graph.invoke({"messages": messages})
38
+ answer = messages['messages'][-1].content
39
  print(f"Agent returning fixed answer: {answer}")
40
  return answer
41