FurqanIshaq commited on
Commit
36935a5
·
verified ·
1 Parent(s): a9a6418

Update main_demo.py

Browse files
Files changed (1) hide show
  1. main_demo.py +22 -13
main_demo.py CHANGED
@@ -1,13 +1,22 @@
1
- from graph_pipeline import textdoctor_app, TextDoctorState
2
-
3
- if __name__ == "__main__":
4
- state: TextDoctorState = {
5
- "input_text": "bro i need 2 more days for this, hope thats okay, i had some issues so couldnt finish on time"
6
- }
7
-
8
- final_state = textdoctor_app.invoke(state)
9
-
10
- print("Original:", final_state["input_text"])
11
- print("\nFinal:", final_state["review_result"]["final_text"])
12
- print("\nDecision explanation:")
13
- print(final_state["review_result"]["decision_explanation"])
 
 
 
 
 
 
 
 
 
 
1
+ from graph_pipeline import textdoctor_app, TextDoctorState
2
+
3
+ if __name__ == "__main__":
4
+ try:
5
+ print("=== TextDoctor CLI ===")
6
+ user_text = input("\nEnter your text: ").strip()
7
+
8
+ if not user_text:
9
+ print("❌ No text entered.")
10
+ exit()
11
+
12
+ state: TextDoctorState = {"input_text": user_text}
13
+ final_state = textdoctor_app.invoke(state)
14
+
15
+ print("\n--- Final Output ---")
16
+ print(final_state["review_result"]["final_text"])
17
+
18
+ print("\n--- Explanation ---")
19
+ print(final_state["review_result"]["decision_explanation"])
20
+
21
+ except Exception as e:
22
+ print("\n❌ An error occurred:", e)