## List Events

`events.list(EventListParams**kwargs)  -> EventListResponse`

**get** `/events`

List events for a specific task and agent.

Optionally filter for events after a specific sequence ID.
Results are ordered by sequence_id.

### Parameters

- `agent_id: str`

  The agent ID to filter events by

- `task_id: str`

  The task ID to filter events by

- `last_processed_event_id: Optional[str]`

  Optional event ID to get events after this ID

- `limit: Optional[int]`

  Optional limit on number of results

### Returns

- `List[Event]`

  - `id: str`

    The UUID of the event

  - `agent_id: str`

    The UUID of the agent that the event belongs to

  - `sequence_id: int`

    The sequence ID of the event

  - `task_id: str`

    The UUID of the task that the event belongs to

  - `content: Optional[TaskMessageContent]`

    The content of the event

    - `class TextContent: …`

      - `author: MessageAuthor`

        The role of the messages author, in this case `system`, `user`, `assistant`, or `tool`.

        - `"user"`

        - `"agent"`

      - `content: str`

        The contents of the text message.

      - `attachments: Optional[List[Attachment]]`

        Optional list of file attachments with structured metadata.

        - `file_id: str`

          The unique ID of the attached file

        - `name: str`

          The name of the file

        - `size: int`

          The size of the file in bytes

        - `type: str`

          The MIME type or content type of the file

      - `format: Optional[TextFormat]`

        The format of the message. This is used by the client to determine how to display the message.

        - `"markdown"`

        - `"plain"`

        - `"code"`

      - `style: Optional[MessageStyle]`

        The style of the message. This is used by the client to determine how to display the message.

        - `"static"`

        - `"active"`

      - `type: Optional[Literal["text"]]`

        The type of the message, in this case `text`.

        - `"text"`

    - `class ReasoningContent: …`

      - `author: MessageAuthor`

        The role of the messages author, in this case `system`, `user`, `assistant`, or `tool`.

      - `summary: List[str]`

        A list of short reasoning summaries

      - `content: Optional[List[str]]`

        The reasoning content or chain-of-thought text

      - `style: Optional[MessageStyle]`

        The style of the message. This is used by the client to determine how to display the message.

      - `type: Optional[Literal["reasoning"]]`

        The type of the message, in this case `reasoning`.

        - `"reasoning"`

    - `class DataContent: …`

      - `author: MessageAuthor`

        The role of the messages author, in this case `system`, `user`, `assistant`, or `tool`.

      - `data: Dict[str, object]`

        The contents of the data message.

      - `style: Optional[MessageStyle]`

        The style of the message. This is used by the client to determine how to display the message.

      - `type: Optional[Literal["data"]]`

        The type of the message, in this case `data`.

        - `"data"`

    - `class ToolRequestContent: …`

      - `arguments: Dict[str, object]`

        The arguments to the tool.

      - `author: MessageAuthor`

        The role of the messages author, in this case `system`, `user`, `assistant`, or `tool`.

      - `name: str`

        The name of the tool that is being requested.

      - `tool_call_id: str`

        The ID of the tool call that is being requested.

      - `style: Optional[MessageStyle]`

        The style of the message. This is used by the client to determine how to display the message.

      - `type: Optional[Literal["tool_request"]]`

        The type of the message, in this case `tool_request`.

        - `"tool_request"`

    - `class ToolResponseContent: …`

      - `author: MessageAuthor`

        The role of the messages author, in this case `system`, `user`, `assistant`, or `tool`.

      - `content: object`

        The result of the tool.

      - `name: str`

        The name of the tool that is being responded to.

      - `tool_call_id: str`

        The ID of the tool call that is being responded to.

      - `is_error: Optional[bool]`

        Whether the tool call resulted in an error. `None` when the harness does not report a status.

      - `style: Optional[MessageStyle]`

        The style of the message. This is used by the client to determine how to display the message.

      - `type: Optional[Literal["tool_response"]]`

        The type of the message, in this case `tool_response`.

        - `"tool_response"`

  - `created_at: Optional[datetime]`

    The timestamp of the event

### Example

```python
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
)
events = client.events.list(
    agent_id="agent_id",
    task_id="task_id",
)
print(events)
```

#### Response

```json
[
  {
    "id": "id",
    "agent_id": "agent_id",
    "sequence_id": 0,
    "task_id": "task_id",
    "content": {
      "author": "user",
      "content": "content",
      "attachments": [
        {
          "file_id": "file_id",
          "name": "name",
          "size": 0,
          "type": "type"
        }
      ],
      "format": "markdown",
      "style": "static",
      "type": "text"
    },
    "created_at": "2019-12-27T18:11:19.117Z"
  }
]
```
