Spaces:
Sleeping
Sleeping
Download src/state.py from Thanos/Final_Assignment_Template: direct link, hf CLI and curl.
- Browser
- Download file 1.13 kB
-
https://huggingface.co/spaces/Thanos/Final_Assignment_Template/resolve/main/src/state.py
- Command line
-
hf download hf://spaces/Thanos/Final_Assignment_Template/src/state.py
-
curl -L -o state.py https://huggingface.co/spaces/Thanos/Final_Assignment_Template/resolve/main/src/state.py
1.13 kB
| from typing import List, Optional, TypedDict | |
| from langchain_core.messages import AIMessage, HumanMessage | |
| class AgentState(TypedDict): | |
| """ | |
| Represents the state of an agent during a multi-step query process. | |
| Attributes: | |
| original_query (str): The initial query provided by the user. | |
| subqueries (List[str]): A list of subqueries derived from the | |
| original query. | |
| current_step (int): The index of the current step or subquery | |
| being processed. | |
| results (List[str]): The results obtained for each subquery. | |
| final_answer (Optional[str]): The final answer generated by the agent, | |
| if available. | |
| messages (List[HumanMessage | AIMessage]): The conversation history, | |
| including both human and AI | |
| messages. | |
| """ | |
| original_query: str | |
| subqueries: List[str] | |
| current_step: int | |
| results: List[str] | |
| final_answer: Optional[str] | |
| messages: List[HumanMessage | AIMessage] | |