- 将Configuration重构为Context,支持动态工具配置 - 新增state.py和tools.py模块,优化状态管理和工具处理 - 移除旧的tools_factory.py和registry.py - 更新前端API引用路径,修复brandApi命名错误 - 调整README和更新日志,反映架构变更 - 优化智能体历史记录管理,改进SQLite检查点 - 修复默认智能体加载和工具展示问题
23 lines
607 B
Python
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
|
|
)
|