Skip to content

States

Create Task State
states.create(StateCreateParams**kwargs) -> State
POST/states
List States
states.list(StateListParams**kwargs) -> StateListResponse
GET/states
Get State by State ID
states.retrieve(strstate_id) -> State
GET/states/{state_id}
Update Task State
states.update(strstate_id, StateUpdateParams**kwargs) -> State
PUT/states/{state_id}
Delete Task State
states.delete(strstate_id) -> State
DELETE/states/{state_id}
ModelsExpand Collapse
class State: …

Represents a state in the agent system. A state is associated uniquely with a task and an agent.

This entity is used to store states in MongoDB, with each state associated with a specific task and agent. The combination of task_id and agent_id is globally unique.

The state is a dictionary of arbitrary data.

id: str

The task state’s unique id

agent_id: str
created_at: datetime

The timestamp when the state was created

formatdate-time
state: Dict[str, object]
task_id: str
updated_at: Optional[datetime]

The timestamp when the state was last updated

formatdate-time
List[State]
id: str

The task state’s unique id

agent_id: str
created_at: datetime

The timestamp when the state was created

formatdate-time
state: Dict[str, object]
task_id: str
updated_at: Optional[datetime]

The timestamp when the state was last updated

formatdate-time