Skip to content

获取会话列表

介绍

此 API 用于获取特定 Agent 的会话列表。通过提供 robot_id(agent_id),可以检索到相关的会话列表信息。请求成功时,通常会返回包含一个或多个会话的列表,每个会话包含会话的详细信息。

基本信息

POST https://ai-api.betteryeah.com/v1/oapi/agent/chat/conversation/list

请求头

名称类型是否必填描述示例
Content-Typestringtrue固定值 "application/json"application/json
Access-Keystringtrue用于认证的访问密钥,获取参照:获取请求相关信息NjMyZDZlMTFkNGUxNGU2NjhmMGY5MWFlLDEwMDAsMTY5NTA5ODEwNjkwMA==
Workspace-Idstringtrue工作空间 ID,获取参照:获取请求相关信息632d6e11d4e14e668f0f91ae

示例

javascript
Content-Type:application/json
Access-Key:NjMyZDZlMTFkNGUxNGU2NjhmMGY5MWFlLDEwMDAsMTY5NTA5ODEwNjkwMA==
Workspace-Id:632d6e11d4e14e668f0f91ae

请求体

名称类型是否必填描述示例
robot_idstringtrueagent的唯一标识符,获取参照:获取请求相关信息eaadc9531f0240d9beaf2bae98ea0e32

示例

javascript
{
    "robot_id": "eaadc9531f0240d9beaf2bae98ea0e32"
}

请求示例

javascript
curl --location 'https://ai-api.betteryeah.com/v1/oapi/agent/chat/conversation/list' \
--header 'Content-Type: application/json' \
--header 'Access-Key: NjMyZDZlMTFkNGUxNGU2NjhmMGY5MWFlLDEwMDAsMTY5NTA5ODEwNjkwMA==' \
--header 'Workspace-Id: 632d6e11d4e14e668f0f91ae' \
--data '{
        "robot_id": "eaadc9531f0240d9beaf2bae98ea0e32"
}'

响应

名称类型描述示例
datalist
conversation_idstring会话 id612e2a8d44174350a21233ab62e4dc05
uidstring用户 idxxxx
titlestring会话标题如何学习孙子兵法
robot_idintagent_idc78ef4af92d24c7cb42a5ed99bdea40e
robot_namestringAgent名称2024-03-20T15:53:57.872085
robot_avatarstring对话 idcea370613472493db49b7a74d9754ea9
update_timetimestamp更新时间2024-03-21T16:10:51.361383
latest_create_timetimestamp最后更新时间2024-03-21T16:10:51.361383
run_typestring运行方式默认值:AGENT_OAPI
robot_colorstringagent头像背景色Deprecated
robot_iconstringagent头像https://xxx.png
robot_welcome_messagestringagent 欢迎语跟我一起来学习孙子兵法
codenumberAPI响应的状态码200|500等
successbooleaAPI调用是否成功。true表示成功,而false表示失败。true|false
messagestringAPI响应的状态消息"SUCCESS"或者"请求失败,原因 xxxx"
now_timenumber服务器当前的时间戳(以秒为单位)

响应示例

javascript
{
    "code": 200,
    "success": true,
    "message": "SUCCESS",
    "data": [
        {
            "conversation_id": "bc21a56c39b247e892541a69f56be3cc",
            "uid": -1000,
            "title": "总结孙子兵法形篇",
            "robot_id": "eaadc9531f0240d9beaf2bae98ea0e32",
            "robot_name": "孙子兵法学习助理",
            "robot_avatar": "",
            "update_time": "2024-03-21T16:10:51.361383",
            "latest_create_time": "2024-03-21T16:10:51.361383",
            "run_type": "AGENT_OAPI",
            "robot_color": "",
            "robot_icon": "https://resource.bantouyan.com/betteryeah/agent/avatars/avatar-7.png",
            "robot_welcome_message": ""
        },
        {
            "conversation_id": "e63fb7c8b047418c84a737c7556a7f3e",
            "uid": -1000,
            "title": "如何学习孙子兵法",
            "robot_id": "eaadc9531f0240d9beaf2bae98ea0e32",
            "robot_name": "孙子兵法学习助理",
            "robot_avatar": "",
            "update_time": "2024-03-20T16:14:25.643519",
            "latest_create_time": "2024-03-20T16:14:25.643519",
            "run_type": "AGENT_OAPI",
            "robot_color": "",
            "robot_icon": "https://resource.bantouyan.com/betteryeah/agent/avatars/avatar-7.png",
            "robot_welcome_message": ""
        }
    ],
    "now_time": 1711008658
}