List Conversation Messages
智能体接口
Conversation Messages History
List agent conversation messages
GET
List Conversation Messages
Documentation Index
Fetch the complete documentation index at: https://docs.reportify.cn/llms.txt
Use this file to discover all available pages before exploring further.
获取对话消息列表
URL:/v1/agent/conversations/{conversation_id}/messages方法:
GET描述: 获取指定对话的消息列表,支持分页查询。
路径参数
| 参数名 | 类型 | 必填 | 描述 |
|---|---|---|---|
| conversation_id | integer | 是 | 对话 ID |
查询参数
| 参数名 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
| limit | integer | 否 | 10 | 返回的消息数量(最小值:1,最大值:100) |
| before_message_id | integer | 否 | - | 获取此消息 ID 之前创建的消息 |
响应参数
| 参数名 | 类型 | 描述 |
|---|---|---|
| messages | array | 消息列表,每个元素为消息对象 |
消息对象结构
| 参数名 | 类型 | 描述 |
|---|---|---|
| id | integer | 消息 ID |
| user_id | integer | 用户 ID |
| conversation_id | integer | 对话 ID |
| turn_id | integer | 对话轮次 ID |
| role | string | 消息角色(user 或 assistant) |
| reply_to_message_id | integer | 回复的消息 ID(可为 null) |
| content | object | 消息内容(可为 null) |
| status | string | 消息状态 |
| error_info | object | 错误信息(可为 null) |
| assistant_message_id | string | 助手消息 ID(可为 null) |
| created_at | integer | 创建时间戳(毫秒) |
| updated_at | integer | 更新时间戳(毫秒) |
| assistant_events | array | 助手事件列表(可为 null) |
示例代码
cURL 示例
cURL 示例(分页查询)
Python 示例
Python 示例(分页查询)
响应示例
注意事项
- 消息按创建时间倒序排列(最新的消息在前)
- 使用
before_message_id参数可以实现向前翻页 limit参数的有效范围为 1-100- 建议每次请求不超过 50 条消息,以获得更好的性能
Authorizations
Enter your Bearer token
Path Parameters
对话 ID
Query Parameters
返回的消息数量 Number of messages to return
Required range:
1 <= x <= 100获取此消息 ID 之前创建的消息 Fetch messages created before this message id
Response
Successful Response
消息列表
