| from typing import TypedDict, Annotated, List, Union |
| from langchain_core.messages import BaseMessage |
| import operator |
|
|
| class AgentState(TypedDict): |
| |
| messages: Annotated[List[BaseMessage], operator.add] |
| |
| |
| user_role: str |
| intent_type: str |
| trace_id: str |
| |
| |
| session_id: str |
| patient_id: str |
| fhir_data: List[dict] |
| trend_analysis: str |
| trend_data: dict |
| current_medications: List[dict] |
| |
| |
| is_valid: bool |
| is_safe: bool |
| |
| |
| patient_response: str |
| clinician_outputs: List[str] |
| research_output: str |
| |
| |
| attempts: int |
| |
| |
| sources: Annotated[List[str], operator.add] |
| |
| |
| evidence_citations: Annotated[List[dict], operator.add] |
| |
| |
| logs: Annotated[List[str], operator.add] |
| |
| |
| metrics: Annotated[List[dict], operator.add] |
|
|