Krishp1 commited on
Commit
26b1cee
Β·
verified Β·
1 Parent(s): 5120105

Update nodes.py

Browse files
Files changed (1) hide show
  1. nodes.py +7 -2
nodes.py CHANGED
@@ -523,10 +523,15 @@ EXPLANATION:
523
  "review": "Polished and explained"
524
  }
525
 
 
526
  # ─────────────────────────────────────────
527
  # NODE 13 β€” EXPLAINER (passthrough)
528
  # ─────────────────────────────────────────
529
  def explainer(state: State):
530
- if not state.get("explanation"):
 
531
  return {"explanation": "Code completed successfully. See final code above."}
532
- return {}
 
 
 
 
523
  "review": "Polished and explained"
524
  }
525
 
526
+
527
  # ─────────────────────────────────────────
528
  # NODE 13 β€” EXPLAINER (passthrough)
529
  # ─────────────────────────────────────────
530
  def explainer(state: State):
531
+ explanation = state.get("explanation")
532
+ if not explanation:
533
  return {"explanation": "Code completed successfully. See final code above."}
534
+
535
+ # LangGraph requires a state update.
536
+ # Re-writing the existing explanation satisfies this rule.
537
+ return {"explanation": explanation}