naman1102 commited on
Commit
dc3ed35
·
1 Parent(s): a066788

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -56,7 +56,7 @@ compiled_graph = graph.compile()
56
 
57
  # 3) The corrected respond_to_input:
58
  def respond_to_input(user_input: str) -> str:
59
- # A) Describe your tools exactly—no extra text allowed around JSON
60
  system_msg = SystemMessage(
61
  content=(
62
  "You are an assistant with access to exactly these tools:\n"
@@ -73,14 +73,11 @@ def respond_to_input(user_input: str) -> str:
73
  "If you do not need any tool, simply reply with your final answer as plain text."
74
  )
75
  )
76
-
77
- # B) Start the graph with only the SystemMessage in state["messages"]
78
  initial_state = { "messages": [system_msg] }
79
-
80
- # C) Invoke the graph, passing user_input separately
81
  final_state = compiled_graph.invoke(initial_state, user_input)
82
-
83
- # D) Log out everything the agent wrote, so you can diagnose
84
  print("===== AGENT MESSAGES =====")
85
  for i, msg in enumerate(final_state["messages"]):
86
  if isinstance(msg, AIMessage):
 
56
 
57
  # 3) The corrected respond_to_input:
58
  def respond_to_input(user_input: str) -> str:
59
+
60
  system_msg = SystemMessage(
61
  content=(
62
  "You are an assistant with access to exactly these tools:\n"
 
73
  "If you do not need any tool, simply reply with your final answer as plain text."
74
  )
75
  )
76
+
 
77
  initial_state = { "messages": [system_msg] }
 
 
78
  final_state = compiled_graph.invoke(initial_state, user_input)
79
+ print("in respond_to_input : ")
80
+
81
  print("===== AGENT MESSAGES =====")
82
  for i, msg in enumerate(final_state["messages"]):
83
  if isinstance(msg, AIMessage):