---
sidebar:
  hidden: true
title: roboto.ai.core.event
---
## Module Contents

### AgentErrorEvent

```python
class roboto.ai.core.event.AgentErrorEvent(/, **data: Any)
```

`from roboto.ai.agent_thread import AgentErrorEvent`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/ai/core/event.py#L63-L70)

Bases: `pydantic.BaseModel`

Signals that message generation failed or was cancelled.

**Parameters**

- **data** (`Any`)

**Attributes**

- **AgentErrorEvent.error_code** (`str | None`) = `None`: Optional error code for programmatic handling.
- **AgentErrorEvent.error_message** (`str`): User-friendly error message describing what went wrong.

### AgentEvent

```python
type roboto.ai.core.event.AgentEvent = typing.Union[AgentStartTextEvent, AgentTextDeltaEvent, AgentTextEndEvent, AgentToolUseEvent, AgentToolResultEvent, AgentErrorEvent]
```

`from roboto.ai.agent_thread import AgentEvent`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/ai/core/event.py#L73-L80)

### AgentStartTextEvent

```python
class roboto.ai.core.event.AgentStartTextEvent(/, **data: Any)
```

`from roboto.ai.agent_thread import AgentStartTextEvent`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/ai/core/event.py#L13-L14)

Bases: `pydantic.BaseModel`

Signals the beginning of text generation in a chat response.

**Parameters**

- **data** (`Any`)

### AgentTextDeltaEvent

```python
class roboto.ai.core.event.AgentTextDeltaEvent(/, **data: Any)
```

`from roboto.ai.agent_thread import AgentTextDeltaEvent`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/ai/core/event.py#L17-L21)

Bases: `pydantic.BaseModel`

Contains incremental text content as the AI generates its response.

**Parameters**

- **data** (`Any`)

**Attributes**

- **AgentTextDeltaEvent.text** (`str`): Text fragment from the streaming response.

### AgentTextEndEvent

```python
class roboto.ai.core.event.AgentTextEndEvent(/, **data: Any)
```

`from roboto.ai.agent_thread import AgentTextEndEvent`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/ai/core/event.py#L24-L25)

Bases: `pydantic.BaseModel`

Signals the completion of text generation in a chat response.

**Parameters**

- **data** (`Any`)

### AgentToolResultEvent

```python
class roboto.ai.core.event.AgentToolResultEvent(/, **data: Any)
```

`from roboto.ai.agent_thread import AgentToolResultEvent`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/ai/core/event.py#L41-L60)

Bases: `pydantic.BaseModel`

Contains the result of a tool invocation.

**Parameters**

- **data** (`Any`)

**Attributes**

- **AgentToolResultEvent.name** (`str`): Name of the tool that was invoked.
- **AgentToolResultEvent.output** (`dict[str, Any] | None`) = `None`: Raw tool output payload (from the underlying tool_result's `raw_response`). May be `None` for errored invocations or for tools that return no data.
- **AgentToolResultEvent.runtime_ms** (`int | None`) = `None`: Wall-clock execution time of the tool in milliseconds, as reported by the tool-result content. `None` only if the underlying content omits it.
- **AgentToolResultEvent.success** (`bool`): Whether the tool invocation succeeded.
- **AgentToolResultEvent.tool_use_id** (`str`): Unique identifier for this tool invocation.

### AgentToolUseEvent

```python
class roboto.ai.core.event.AgentToolUseEvent(/, **data: Any)
```

`from roboto.ai.agent_thread import AgentToolUseEvent`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/ai/core/event.py#L28-L38)

Bases: `pydantic.BaseModel`

Signals that the AI is invoking a tool to gather information.

**Parameters**

- **data** (`Any`)

**Attributes**

- **AgentToolUseEvent.input** (`dict[str, Any] | None`) = `None`: Parsed tool input parameters chosen by the LLM.
- **AgentToolUseEvent.name** (`str`): Name of the tool being invoked.
- **AgentToolUseEvent.tool_use_id** (`str`): Unique identifier for this tool invocation.
