2025-10-27 15:32:12 +08:00
|
|
|
"""Define the state structures for the agent."""
|
|
|
|
|
|
|
|
|
|
from __future__ import annotations
|
|
|
|
|
|
|
|
|
|
from collections.abc import Sequence
|
|
|
|
|
from dataclasses import dataclass, field
|
|
|
|
|
from typing import Annotated
|
|
|
|
|
|
|
|
|
|
from langchain.messages import AnyMessage
|
|
|
|
|
from langgraph.graph import add_messages
|
|
|
|
|
|
2025-10-28 08:22:52 +08:00
|
|
|
from src.agents.common.state import BaseState
|
|
|
|
|
|
2025-10-27 15:32:12 +08:00
|
|
|
|
|
|
|
|
@dataclass
|
2025-10-28 08:22:52 +08:00
|
|
|
class State(BaseState):
|
2025-10-27 15:32:12 +08:00
|
|
|
"""Defines the input state for the agent, representing a narrower interface to the outside world.
|
|
|
|
|
|
|
|
|
|
This class is used to define the initial state and structure of incoming data.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
messages: Annotated[Sequence[AnyMessage], add_messages] = field(default_factory=list)
|