Furqan1111 commited on
Commit
ce3c319
·
verified ·
1 Parent(s): 6807149

Create main_demo.py

Browse files
Files changed (1) hide show
  1. main_demo.py +22 -0
main_demo.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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)