File size: 908 Bytes
0fd7e61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from dataclasses import Field
from langgraph.pregel.main import Topic
from typing_extensions import Annotated,Sequence,List,TypedDict
from pydantic import BaseModel ,Field
from langchain_core.messages import BaseMessage
from langgraph.graph.message import add_messages
from typing import Literal
class AgentState(TypedDict):
    """

    Represents the state of the agent.



    Attributes:

        messages (Annotated[Sequence[BaseMessage], add_messages]): The sequence of messages in the conversation.

    """
    messages: Annotated[Sequence[BaseMessage], add_messages]
    search_results: List[str]
    search_content:str
    query: str

class search_keys(BaseModel):
    query:str = Field(description='this is the query that the user want to search')
    Topic:Literal["general", "news", "finance"] = Field(description='this is the topic that the user want to search about')