File size: 511 Bytes
2862b00
bf7aca6
2862b00
 
 
 
 
bf7aca6
c3b49d6
bf7aca6
 
 
c3b49d6
 
bf7aca6
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"""
Agent state creation for CodeAct Agent.
"""

import time


def create_agent_state(
    messages: list = None,
    step_count: int = 0,
    error_count: int = 0,
    start_time: float = None,
    current_plan: str | None = None,
) -> dict:
    """Create a standardized agent state dictionary."""
    return {
        "messages": messages or [],
        "step_count": step_count,
        "error_count": error_count,
        "start_time": start_time or time.time(),
        "current_plan": current_plan,
    }