-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstate.py
More file actions
59 lines (53 loc) · 2.25 KB
/
Copy pathstate.py
File metadata and controls
59 lines (53 loc) · 2.25 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
54
55
56
57
58
59
"""Shared state definition for the presentation generation pipeline.
Defines PresentationState, the single TypedDict that flows through every node
in the LangGraph graph. Every agent reads from and writes to this state — it is
the contract between all pipeline components.
State lifecycle:
main.py initialises the dict → graph.astream() passes it through each
node → each node returns a partial dict that LangGraph merges back.
"""
from typing import TypedDict, Annotated
from langgraph.graph.message import add_messages
class PresentationState(TypedDict):
"""Shared state object flowing through every node in the LangGraph graph.
Attributes:
topic: Raw presentation topic from the user.
expanded_topic: Researcher's enriched description with subtopics.
research_results: List of dicts with 'title', 'summary', 'source_url'.
slide_outline: Parsed slide structure from Writer's markdown.
slide_content: Full markdown for all slides (sent to Gamma).
num_slides: Target slide count (--slides flag, default 10).
validation_feedback: Validator's feedback on why content failed.
validation_passed: True if Validator scored >= 7/10.
revision_count: How many revision cycles completed so far.
max_revisions: Max allowed revisions before force-publish (--max-revisions).
gamma_url: Published Gamma URL, or sentinel: DRY_RUN/FALLBACK_MARKDOWN/TIMEOUT.
gamma_generation_id: Gamma generation ID from MCP response.
messages: LangChain message history (appended via add_messages reducer).
current_agent: Name of the most recently active agent.
status: Human-readable pipeline phase string.
dry_run: When True, skip Gamma and print markdown to stdout.
"""
# Input
topic: str
expanded_topic: str
# Research
research_results: list[dict]
# Content
slide_outline: list[dict]
slide_content: str
num_slides: int
# Validation
validation_feedback: str
validation_passed: bool
revision_count: int
max_revisions: int
# Publishing
gamma_url: str
gamma_generation_id: str
# Metadata
messages: Annotated[list, add_messages]
current_agent: str
status: str
# Runtime flags
dry_run: bool