from typing import TypedDict, Literal, List, Optional class Message(TypedDict): role: Literal["user", "assistant"] content: str class ChatState(TypedDict, total=False): last_user_msg: bool last_user_msg_content: str test: str validated: bool noValidated: str first_stage_iterations: int stage: str situation: str think: str emotion: str introduction_end_flag: bool awaitingUser: bool safetyFlag: bool messages: List[Message] messages_detect: List[Message] messages_socratic: List[Message] distortion: str distortion_text: str distortion_def: str current_intention: str priority_check: List[str] socratic_question: str cue_hit: bool confidence: float question: int distortion_explained: bool cel: str wniosek: str explanation: str decision_explanation: str proposition: str classify_result: str