File size: 793 Bytes
c751e97
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from typing import List, Dict, TypedDict, Sequence, Union, Annotated

from langchain_core.messages import BaseMessage
from langgraph.graph.message import add_messages


class Context(TypedDict):
    """PCS + geonames context payload for common tasks like recommendations.
    """
    subject: List[str]
    population: List[str]
    geography: List[Union[str, int]]


class AgentState(TypedDict):
    """State of the chat agent for the execution graph(s).
    """
    # The add_messages function defines how an update should be processed
    # Default is to replace. add_messages says "append"
    messages: Annotated[Sequence[BaseMessage], add_messages]
    user_input: str
    org_dict: Dict

    # Recommendation-specific fields
    intent: str
    context: Context
    recommendation: str