Skip to content

List States

states.list(StateListParams**kwargs) -> StateListResponse
GET/states

List all states, optionally filtered by query parameters.

ParametersExpand Collapse
agent_id: Optional[str]

Agent ID

limit: Optional[int]

Limit

minimum1
order_by: Optional[str]

Field to order by

order_direction: Optional[str]

Order direction (asc or desc)

page_number: Optional[int]

Page number

minimum1
task_id: Optional[str]

Task ID

ReturnsExpand Collapse
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

List States

import os
from agentex import Agentex

client = Agentex(
    api_key=os.environ.get("AGENTEX_SDK_API_KEY"),  # This is the default and can be omitted
)
states = client.states.list()
print(states)
[
  {
    "id": "id",
    "agent_id": "agent_id",
    "created_at": "2019-12-27T18:11:19.117Z",
    "state": {
      "foo": "bar"
    },
    "task_id": "task_id",
    "updated_at": "2019-12-27T18:11:19.117Z"
  }
]
Returns Examples
[
  {
    "id": "id",
    "agent_id": "agent_id",
    "created_at": "2019-12-27T18:11:19.117Z",
    "state": {
      "foo": "bar"
    },
    "task_id": "task_id",
    "updated_at": "2019-12-27T18:11:19.117Z"
  }
]