ForcePilot/src/agents/chatbot/state.py
Wenjie Zhang b524ca687b feat(agents): 重构智能体系统,引入Context替代Configuration
- 将Configuration重构为Context,支持动态工具配置
- 新增state.py和tools.py模块,优化状态管理和工具处理
- 移除旧的tools_factory.py和registry.py
- 更新前端API引用路径,修复brandApi命名错误
- 调整README和更新日志,反映架构变更
- 优化智能体历史记录管理,改进SQLite检查点
- 修复默认智能体加载和工具展示问题
2025-08-31 00:34:26 +08:00

23 lines
607 B
Python

"""Define the state structures for the agent."""
from __future__ import annotations
from dataclasses import dataclass, field
from collections.abc import Sequence
from langchain_core.messages import AnyMessage
from langgraph.graph import add_messages
from typing import Annotated
@dataclass
class State:
"""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
)