Spaces:
Sleeping
Sleeping
| from setting_up_langraph import compiled_graph | |
| legitimate_email = { | |
| "sender": "[email protected]", | |
| "subject": "Question about your services", | |
| "body": "Dear Mr. Hugg, I was referred to you by a colleague and I'm interested in learning more about your consulting services. Could we schedule a call next week? Best regards, John Smith" | |
| } | |
| # Example spam email | |
| spam_email = { | |
| "sender": "[email protected]", | |
| "subject": "YOU HAVE WON $5,000,000!!!", | |
| "body": "CONGRATULATIONS! You have been selected as the winner of our international lottery! To claim your $5,000,000 prize, please send us your bank details and a processing fee of $100." | |
| } | |
| # Process the legitimate email | |
| print("\nProcessing legitimate email...") | |
| legitimate_result = compiled_graph.invoke({ | |
| "email": legitimate_email, | |
| "is_spam": None, | |
| "spam_reason": None, | |
| "email_category": None, | |
| "email_draft": None, | |
| "messages": [] | |
| }) | |
| # Process the spam email | |
| print("\nProcessing spam email...") | |
| spam_result = compiled_graph.invoke({ | |
| "email": spam_email, | |
| "is_spam": None, | |
| "spam_reason": None, | |
| "email_category": None, | |
| "email_draft": None, | |
| "messages": [] | |
| }) | |
| compiled_graph.get_graph().draw_mermaid_png() |