Download state.py from agents-course/Final_Assignment_Template: direct link, hf CLI and curl.
- Browser
- Download file 908 Bytes
-
https://huggingface.co/spaces/agents-course/Final_Assignment_Template/resolve/refs%2Fpr%2F252/state.py
- Command line
-
hf download hf://spaces/agents-course/Final_Assignment_Template@refs/pr/252/state.py
-
curl -L -o state.py https://huggingface.co/spaces/agents-course/Final_Assignment_Template/resolve/refs%2Fpr%2F252/state.py
908 Bytes
| 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') | |