Download app/agent/state.py from acpcchatbotadmin/acpcchatbot_testing_first: direct link, hf CLI and curl.
- Browser
- Download file 946 Bytes
-
https://huggingface.co/spaces/acpcchatbotadmin/acpcchatbot_testing_first/resolve/main/app/agent/state.py
- Command line
-
hf download hf://spaces/acpcchatbotadmin/acpcchatbot_testing_first/app/agent/state.py
-
curl -L -o state.py https://huggingface.co/spaces/acpcchatbotadmin/acpcchatbot_testing_first/resolve/main/app/agent/state.py
946 Bytes
| from typing import Annotated | |
| from typing_extensions import TypedDict | |
| from langchain_core.documents import Document | |
| from langchain_core.messages import BaseMessage | |
| from langgraph.graph.message import add_messages | |
| class AgentState(TypedDict): | |
| # Conversation history (managed by LangGraph add_messages reducer) | |
| messages: Annotated[list[BaseMessage], add_messages] | |
| # Current user query (possibly rewritten) | |
| query: str | |
| # Raw retrieval results (before grading) | |
| retrieved_documents: list[Document] | |
| # Graded relevant documents | |
| relevant_documents: list[Document] | |
| # LLM-generated answer text | |
| generation: str | |
| # Source metadata list for API response | |
| sources: list[dict] | |
| # Confidence score (fraction of retrieved docs that are relevant) | |
| confidence: float | |
| # Number of retrieval retries (for query rewriting loop) | |
| retry_count: int | |
| # Routing decision | |
| route: str | |