create state
Browse files
state
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import operator
|
| 2 |
+
from typing import Annotated, TypedDict, List, Optional
|
| 3 |
+
|
| 4 |
+
from langchain_core.messages import BaseMessage
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
class AgentState(TypedDict):
|
| 8 |
+
"""
|
| 9 |
+
state passed between every node in the graph.
|
| 10 |
+
Fields
|
| 11 |
+
-----
|
| 12 |
+
messages: Includes conversation history without replacing.
|
| 13 |
+
task_id: Unique task Identifier of GAIA
|
| 14 |
+
question: random ques from GAIA API
|
| 15 |
+
level: The difficulty level of the task
|
| 16 |
+
file_name: Optional filename attached to the question
|
| 17 |
+
answer: The extracted answer
|
| 18 |
+
|
| 19 |
+
"""
|
| 20 |
+
|
| 21 |
+
messages: Annotated[List[BaseMessage], operator.add]
|
| 22 |
+
task_id: str
|
| 23 |
+
question: str
|
| 24 |
+
level: str
|
| 25 |
+
file_name: str
|
| 26 |
+
answer: str
|
| 27 |
+
file_name: Optional[str]
|
| 28 |
+
answer: Optional[str]
|
| 29 |
+
|