cryogenic22 commited on
Commit
833db7d
·
verified ·
1 Parent(s): 21aa8e8

Update agents/understanding.py

Browse files
Files changed (1) hide show
  1. agents/understanding.py +16 -1
agents/understanding.py CHANGED
@@ -67,4 +67,19 @@ def understanding_agent(anthropic_client, state: Dict[str, Any]) -> Dict[str, An
67
  # Parse the structured intent from the response
68
  # This would be more sophisticated in production
69
  new_state["user_intent"] = {
70
- "understood": T
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  # Parse the structured intent from the response
68
  # This would be more sophisticated in production
69
  new_state["user_intent"] = {
70
+ "understood": True,
71
+ "description": agent_response.replace("INTENT_COMPLETE", "").strip(),
72
+ "time": time.time()
73
+ } # Added the missing closing brace here
74
+ new_state["current_agent"] = "planning_agent"
75
+ else:
76
+ # Need more information, stay with understanding agent
77
+ new_state["current_agent"] = "understanding_agent"
78
+
79
+ # Add agent's response to messages
80
+ new_messages = add_messages(state, [
81
+ {"role": "assistant", "content": agent_response.replace("INTENT_COMPLETE", "").strip()}
82
+ ])
83
+ new_state["messages"] = new_messages
84
+
85
+ return new_state