2025-04-17 11:34:42 +08:00
|
|
|
# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
|
2025-04-07 16:25:55 +08:00
|
|
|
import operator
|
|
|
|
|
|
|
|
|
|
from langgraph.graph import MessagesState
|
|
|
|
|
from typing import Annotated
|
|
|
|
|
from src.prompts.planner_model import Plan
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class State(MessagesState):
|
|
|
|
|
"""State for the agent system, extends MessagesState with next field."""
|
|
|
|
|
|
|
|
|
|
# Runtime Variables
|
|
|
|
|
observations: Annotated[list[str], operator.add] = []
|
|
|
|
|
plan_iterations: int = 0
|
2025-04-14 18:01:50 +08:00
|
|
|
current_plan: Plan | str = None
|
2025-04-07 16:25:55 +08:00
|
|
|
final_report: str = ""
|
2025-04-14 18:01:50 +08:00
|
|
|
auto_accepted_plan: bool = False
|