-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_workflow.py
More file actions
39 lines (31 loc) · 1.07 KB
/
Copy pathtest_workflow.py
File metadata and controls
39 lines (31 loc) · 1.07 KB
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
39
import os
import sys
from src.orchestrator.langgraph_workflow import run_workflow
def test_workflow():
print("Starting test workflow...")
topic = "The Future of Quantum Computing in 2025"
print(f"Topic: {topic}")
try:
result = run_workflow(topic)
print("\nWorkflow Result:")
print(result)
if "error" in result:
print("FAILED: Workflow returned error.")
sys.exit(1)
docx = result.get("docx")
pdf = result.get("pdf")
if docx and os.path.exists(docx):
print(f"SUCCESS: DOCX generated at {docx}")
else:
print("FAILED: DOCX invalid.")
if pdf and os.path.exists(pdf):
print(f"SUCCESS: PDF generated at {pdf}")
else:
print("FAILED: PDF invalid.")
except Exception as e:
print(f"FAILED: Exception during workflow: {e}")
sys.exit(1)
if __name__ == "__main__":
# Ensure output dir exists
os.makedirs("outputs", exist_ok=True)
test_workflow()