File size: 639 Bytes
6c9ca3f
4f25f4e
 
6c9ca3f
c99f0eb
4f25f4e
6c9ca3f
4f25f4e
 
6c9ca3f
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from typing import List, Dict, Any, Optional, TypedDict, Annotated
import json
from langchain.schema import SystemMessage, HumanMessage, AIMessage, BaseMessage
from langgraph.graph.message import add_messages


class AgentState(TypedDict):
    """Single source‑of‑truth context for one user query run."""
    user_question: str
    task_id: Optional[str] 
    messages: Annotated[List[BaseMessage], add_messages]
    next_action: Optional[str]      # wiki | ocr | audio | final
    query: Optional[str]            # wiki search term
    snippet: Optional[str]          # code snippet
    tool_calls: int
    final_answer: Optional[str]