-
Notifications
You must be signed in to change notification settings - Fork 12
/
main.py
40 lines (33 loc) · 852 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from colorama import Fore, Style
from src.graph import Workflow
from dotenv import load_dotenv
# Load all env variables
load_dotenv()
# config
config = {'recursion_limit': 100}
workflow = Workflow()
app = workflow.app
initial_state = {
"emails": [],
"current_email": {
"id": "",
"threadId": "",
"messageId": "",
"references": "",
"sender": "",
"subject": "",
"body": ""
},
"email_category": "",
"generated_email": "",
"rag_queries": [],
"retrieved_documents": "",
"writer_messages": [],
"sendable": False,
"trials": 0
}
# Run the automation
print(Fore.GREEN + "Starting workflow..." + Style.RESET_ALL)
for output in app.stream(initial_state, config):
for key, value in output.items():
print(Fore.CYAN + f"Finished running: {key}:" + Style.RESET_ALL)