> ## Documentation Index
> Fetch the complete documentation index at: https://ikun.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# RunResponse

## RunResponse Attributes

| Attribute           | Type                   | Default | Description                                                                                       |
| ------------------- | ---------------------- | ------- | ------------------------------------------------------------------------------------------------- |
| `content`           | `Any`                  | `None`  | 响应内容。                                                                                             |
| `content_type`      | `str`                  | `"str"` | 指定内容的`data`类型。                                                                                    |
| `thinking`          | `str`                  | `None`  | 模型生成的任何思考内容（供 Anthropic 模型使用）。                                                                    |
| `reasoning_content` | `str`                  | `None`  | 模型生成的任何推理内容。                                                                                      |
| `messages`          | `List[Message]`        | `None`  | 响应中包含的消息列表。                                                                                       |
| `metrics`           | `Dict[str, Any]`       | `None`  | 运行的使用情况指标。                                                                                        |
| `model`             | `str`                  | `None`  | 运行中使用的模型。                                                                                         |
| `model_provider`    | `str`                  | `None`  | 运行中使用的模型提供商。                                                                                      |
| `run_id`            | `str`                  | `None`  | 运行 ID。                                                                                            |
| `agent_id`          | `str`                  | `None`  | 运行的 Agent ID。                                                                                     |
| `session_id`        | `str`                  | `None`  | 运行的 Session ID。                                                                                   |
| `tools`             | `List[Dict[str, Any]]` | `None`  | 提供给模型的工具列表。                                                                                       |
| `images`            | `List[Image]`          | `None`  | 模型生成的图片列表。                                                                                        |
| `videos`            | `List[Video]`          | `None`  | 模型生成的视频列表。                                                                                        |
| `audio`             | `List[Audio]`          | `None`  | 模型生成的音频片段列表。                                                                                      |
| `response_audio`    | `ModelResponseAudio`   | `None`  | 模型原始的音频响应。                                                                                        |
| `citations`         | `Citations`            | `None`  | 响应中使用的任何引文。                                                                                       |
| `created_at`        | `int`                  | -       | 响应创建的 Unix 时间戳。                                                                                   |
| `extra_data`        | `RunResponseExtraData` | `None`  | 包含 `references`, `add_messages`, `history`, `reasoning_steps`, 和 `reasoning_messages` 等可选字段的额外数据。 |

## RunResponseEvent 类型和属性

### 基础 RunResponseEvent 属性

所有事件均继承自 `BaseAgentRunResponseEvent`，它提供了以下通用属性：

| Attribute    | Type            | Default | Description    |
| ------------ | --------------- | ------- | -------------- |
| `created_at` | `int`           | 当前时间戳   | 事件创建的 Unix 时间戳 |
| `event`      | `str`           | 事件类型值   | 事件的类型          |
| `agent_id`   | `str`           | `""`    | 生成事件的 Agent ID |
| `run_id`     | `Optional[str]` | `None`  | 当前运行的 ID       |
| `session_id` | `Optional[str]` | `None`  | 当前会话的 ID       |
| `content`    | `Optional[Any]` | `None`  | 用于向后兼容         |

### RunResponseStartedEvent

| Attribute        | Type  | Default        | Description |
| ---------------- | ----- | -------------- | ----------- |
| `event`          | `str` | `"RunStarted"` | 事件类型        |
| `model`          | `str` | `""`           | 使用的模型       |
| `model_provider` | `str` | `""`           | 模型提供商       |

### RunResponseContentEvent

| Attribute        | Type                             | Default                | Description |
| ---------------- | -------------------------------- | ---------------------- | ----------- |
| `event`          | `str`                            | `"RunResponseContent"` | 事件类型        |
| `content`        | `Optional[Any]`                  | `None`                 | 响应内容        |
| `content_type`   | `str`                            | `"str"`                | 内容类型        |
| `thinking`       | `Optional[str]`                  | `None`                 | 模型的内部思考过程   |
| `citations`      | `Optional[Citations]`            | `None`                 | 响应中使用的引文    |
| `response_audio` | `Optional[AudioResponse]`        | `None`                 | 模型的音频响应     |
| `image`          | `Optional[ImageArtifact]`        | `None`                 | 响应附带的图片     |
| `extra_data`     | `Optional[RunResponseExtraData]` | `None`                 | 额外的响应数据     |

### RunResponseCompletedEvent

| Attribute           | Type                             | Default          | Description |
| ------------------- | -------------------------------- | ---------------- | ----------- |
| `event`             | `str`                            | `"RunCompleted"` | 事件类型        |
| `content`           | `Optional[Any]`                  | `None`           | 响应的最终内容     |
| `content_type`      | `str`                            | `"str"`          | 内容类型        |
| `reasoning_content` | `Optional[str]`                  | `None`           | 生成的推理内容     |
| `thinking`          | `Optional[str]`                  | `None`           | 模型的内部思考过程   |
| `citations`         | `Optional[Citations]`            | `None`           | 响应中使用的引文    |
| `images`            | `Optional[List[ImageArtifact]]`  | `None`           | 响应附带的图片列表   |
| `videos`            | `Optional[List[VideoArtifact]]`  | `None`           | 响应附带的视频列表   |
| `audio`             | `Optional[List[AudioArtifact]]`  | `None`           | 响应附带的音频片段列表 |
| `response_audio`    | `Optional[AudioResponse]`        | `None`           | 模型的音频响应     |
| `extra_data`        | `Optional[RunResponseExtraData]` | `None`           | 额外的响应数据     |

### RunResponsePausedEvent

| Attribute | Type                            | Default       | Description |
| --------- | ------------------------------- | ------------- | ----------- |
| `event`   | `str`                           | `"RunPaused"` | 事件类型        |
| `tools`   | `Optional[List[ToolExecution]]` | `None`        | 需要确认的工具     |

### RunResponseContinuedEvent

| Attribute | Type  | Default          | Description |
| --------- | ----- | ---------------- | ----------- |
| `event`   | `str` | `"RunContinued"` | 事件类型        |

### RunResponseErrorEvent

| Attribute | Type            | Default      | Description |
| --------- | --------------- | ------------ | ----------- |
| `event`   | `str`           | `"RunError"` | 事件类型        |
| `content` | `Optional[str]` | `None`       | 错误消息        |

### RunResponseCancelledEvent

| Attribute | Type            | Default          | Description |
| --------- | --------------- | ---------------- | ----------- |
| `event`   | `str`           | `"RunCancelled"` | 事件类型        |
| `reason`  | `Optional[str]` | `None`           | 取消原因        |

### ReasoningStartedEvent

| Attribute | Type  | Default              | Description |
| --------- | ----- | -------------------- | ----------- |
| `event`   | `str` | `"ReasoningStarted"` | 事件类型        |

### ReasoningStepEvent

| Attribute           | Type            | Default           | Description |
| ------------------- | --------------- | ----------------- | ----------- |
| `event`             | `str`           | `"ReasoningStep"` | 事件类型        |
| `content`           | `Optional[Any]` | `None`            | 推理步骤内容      |
| `content_type`      | `str`           | `"str"`           | 内容类型        |
| `reasoning_content` | `str`           | `""`              | 详细的推理内容     |

### ReasoningCompletedEvent

| Attribute      | Type            | Default                | Description |
| -------------- | --------------- | ---------------------- | ----------- |
| `event`        | `str`           | `"ReasoningCompleted"` | 事件类型        |
| `content`      | `Optional[Any]` | `None`                 | 推理步骤内容      |
| `content_type` | `str`           | `"str"`                | 内容类型        |

### ToolCallStartedEvent

| Attribute | Type                      | Default             | Description |
| --------- | ------------------------- | ------------------- | ----------- |
| `event`   | `str`                     | `"ToolCallStarted"` | 事件类型        |
| `tool`    | `Optional[ToolExecution]` | `None`              | 正在调用的工具     |

### ToolCallCompletedEvent

| Attribute | Type                            | Default               | Description |
| --------- | ------------------------------- | --------------------- | ----------- |
| `event`   | `str`                           | `"ToolCallCompleted"` | 事件类型        |
| `tool`    | `Optional[ToolExecution]`       | `None`                | 已调用的工具      |
| `content` | `Optional[Any]`                 | `None`                | 工具调用结果      |
| `images`  | `Optional[List[ImageArtifact]]` | `None`                | 工具生成的图片     |
| `videos`  | `Optional[List[VideoArtifact]]` | `None`                | 工具生成的视频     |
| `audio`   | `Optional[List[AudioArtifact]]` | `None`                | 工具生成的音频     |

### MemoryUpdateStartedEvent

| Attribute | Type  | Default                 | Description |
| --------- | ----- | ----------------------- | ----------- |
| `event`   | `str` | `"MemoryUpdateStarted"` | 事件类型        |

### MemoryUpdateCompletedEvent

| Attribute | Type  | Default                   | Description |
| --------- | ----- | ------------------------- | ----------- |
| `event`   | `str` | `"MemoryUpdateCompleted"` | 事件类型        |
