File size: 2,241 Bytes
f54fc8b
343468f
 
e8b7d05
 
343468f
 
 
 
 
 
e8b7d05
 
 
 
 
 
 
 
f54fc8b
 
e83ea81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f54fc8b
 
 
 
e83ea81
 
 
f54fc8b
 
e83ea81
 
 
 
 
 
 
f54fc8b
e83ea81
 
f54fc8b
 
e83ea81
f54fc8b
e83ea81
 
 
 
 
 
 
 
 
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
60
61
62
63
64
65
66
67
68
69
70
71
from typing import Annotated, Literal, Optional
from typing_extensions import TypedDict
from langgraph.graph.message import add_messages
from typing import TypedDict, Annotated, List
from langchain_core.messages import HumanMessage, AIMessage

class State(TypedDict):
    """
    Represents the structure of the state used in the graph.
    """
    messages: Annotated[list, add_messages]
    
    
class PlannerState(TypedDict):
    messages: Annotated[List[HumanMessage | AIMessage], "Conversation history"]
    city: str
    interests: List[str]
    itinerary: str
    start_date: str 
    end_date: str    
    
# class SDLCState(TypedDict):
#     current_step: Literal[
#         "requirements",
#         "generate_user_stories",
#         "po_approval",
#         "generate_code",
#         "code_review",
#         "completed"
#     ]
#     requirements: Optional[str]
#     user_stories: Optional[str]
#     po_feedback: Optional[str]
#     generated_code: Optional[str]
#     review_feedback: Optional[str]
#     decision: Optional[Literal["approved", "feedback"]]
    
# from typing import TypedDict, Optional, Literal

class SDLCState(TypedDict):
    current_step: Literal[
        "requirements",
        "generate_user_stories",
        "product_owner_review",
        "create_design_docs",
        "design_review",
        "generate_code",
        "code_review",
        "fix_code_after_code_review",
        "security_review",
        "fix_code_after_security",
        "write_test_cases",
        "test_cases_review",
        "fix_test_cases",
        "end"
    ]
    decision: Optional[Literal["approved", "feedback"]]
    # Content fields
    requirements: Optional[str]
    user_stories: Optional[str]
    design_docs: Optional[str]
    generated_code: Optional[str]
    test_cases: Optional[str]
    # Feedback fields
    po_feedback: Optional[str]          # Product Owner feedback
    design_feedback: Optional[str]      # Design Review feedback
    code_feedback: Optional[str]        # Code Review feedback
    security_feedback: Optional[str]    # Security Review feedback
    test_case_feedback: Optional[str]   # Test Case Review feedback
    # For human input during interrupts.
    human_decision: Optional[str]