-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify_pipeline.py
More file actions
53 lines (42 loc) · 1.29 KB
/
verify_pipeline.py
File metadata and controls
53 lines (42 loc) · 1.29 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import os
import sys
# Add project root to path
sys.path.append(os.getcwd())
from agents.workflow import app as workflow_app
from core.assembly import Assembler
def test_pipeline():
print("Starting Pipeline Test...")
# Mock Data
raw_content = """
# Understanding AI
AI is like a robot brain. It learns from data.
[[IMG_SUGGESTION: A robot reading a book]]
It helps us everywhere.
"""
initial_state = {
"raw_content": raw_content,
"style": "kids",
"iteration_count": 0,
"glossary_terms": [],
"cleaned_content": "",
"rewritten_content": "",
"critique_feedback": ""
}
print("Running Workflow...")
final_state = workflow_app.invoke(initial_state)
content = final_state.get("rewritten_content")
print("Workflow Output:")
print(content[:200] + "...")
print("Assembling PDF...")
assembler = Assembler()
html = assembler.render_html(content, "Test Doc", "kids")
output = "test_output.pdf"
assembler.generate_pdf(html, output)
if os.path.exists(output):
print(f"SUCCESS: PDF generated at {output}")
# Clean up
# os.remove(output)
else:
print("FAILURE: PDF not found")
if __name__ == "__main__":
test_pipeline()