-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstate.py
More file actions
41 lines (31 loc) · 1.45 KB
/
state.py
File metadata and controls
41 lines (31 loc) · 1.45 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
# state.py
from typing import TypedDict, Optional
from langchain_core.messages import BaseMessage
class AgentState(TypedDict):
"""
The single source of truth that travels
through every node in the graph.
Every field starts empty and gets filled
as the graph progresses node by node.
"""
# ── Input ──────────────────────────────
topic: str
# ── Conversation history ───────────────
# Pure LangGraph manages this directly
# CrewAI was hiding this from us before
messages: list[BaseMessage]
# ── Research stage ─────────────────────
research_notes: Optional[str]
research_attempts: int
research_passed: bool
# ── Concepts stage ─────────────────────
concepts: Optional[str]
# ── Study guide stage ──────────────────
study_guide: Optional[str]
guide_attempts: int
guide_passed: bool
# ── Quiz stage ─────────────────────────
quiz: Optional[str]
# ── Meta ───────────────────────────────
current_node: str
errors: list[str]