记忆管理
更新时间:2026-05-12
设备人物画像清空
接口描述
清空当前设备的人物画像信息
请求语法
JSON
1DELETE /api/v{version}/character-portraits HTTP/1.1
2host: rtc-aiagent.baidubce.com
3content-type: application/json
4authorization: <bce-authorization-string>
请求头域
除公共头域外,无其它特殊头域。
请求参数
| 名称 | 类型 | 是否必选 | 参数位置 | 描述 |
|---|---|---|---|---|
| appId | String | 是 | RequestParam | 互动应用id |
| userId | String | 是 | RequestParam | 业务侧用户的唯一id |
请求示例
JSON
1DELETE /api/v1/character-portraits?appId=appxxx&userId=123456789
2host: rtc-aiagent.baidubce.com
3content-type: application/json
4authorization: {bce-authorization-string}
5x-bce-request-id: {bce-request-id}
响应参数
无
响应示例
JSON
1HTTP/1.1 200 OK
2x-bce-request-id: b06a9214-04d6-4a08-9f5d-966b04604cfb
3date: Mon, 05 Sep 2022 03:25:43 GMT
4transfer-encoding: chunked
5content-type: application/json;charset=UTF-8
6cache-control: no-cache
删除对话上下文
接口描述
删除指定用户在 appId + userId + role 维度下的对话上下文记录。支持按时间范围过滤,仅删除时间戳落在 [beginTime, endTime) 区间内的记录;beginTime 和 endTime 均不传时,删除该维度下全部对话上下文记录。
请求语法
JSON
1DELETE /api/v{version}/contexts HTTP/1.1
2host: rtc-aiagent.baidubce.com
3content-type: application/json
4authorization: <bce-authorization-string>
请求头域
除公共头域外,无其它特殊头域。
请求体
| 参数名 | 参数类型 | 必要性 | 参数描述 |
|---|---|---|---|
| appId | String | 是 | 应用 ID |
| userId | String | 是 | 用户设备 ID |
| role | String | 否 | 角色标识。不传时操作 role 为 null 的数据 |
| beginTime | Long | 否 | 时间范围起点(秒级时间戳,闭区间)。与 endTime 配合使用;不传时默认为 0 |
| endTime | Long | 否 | 时间范围终点(秒级时间戳,开区间)。与 beginTime 配合使用;不传时默认为 Long.MAX_VALUE |
请求示例
JSON
1{
2 "appId": "app_demo",
3 "userId": "device_001",
4 "role": "assistant",
5 "beginTime": 1778083200,
6 "endTime": 1778169600
7}
示例时间范围:2026-05-07 00:00:00 ~ 2026-05-08 00:00:00(北京时间)
响应参数
无
响应示例
JSON
1HTTP/1.1 200 OK
2x-bce-request-id: b06a9214-04d6-4a08-9f5d-966b04604cfb
3date: Mon, 05 Sep 2022 03:25:43 GMT
4transfer-encoding: chunked
5content-type: application/json;charset=UTF-8
6cache-control: no-cache
评价此篇文章
