更新智能体变量

更新时间:2026-02-27 10:05:34LLM 副本以 Markdown 格式查看下载 PDF

本文介绍更新智能体变量的 API。

接口描述

根据设备 ID,更新智能体变量。

接口地址

PUT: /v1.0/cloud/agent/ai/b/devices/{device_id}/agent-variables

请求参数

参数名类型参数位置是否必填说明
device_idStringpathtrue设备 ID

body 说明

参数名类型参数位置是否必填说明
bind_role_typeIntegerbodyfalse绑定角色类型
  • 0:自定义角色
  • 1:模板角色
  • 2:单角色(即无角色,数据在智能体维度上)
role_id 传递时,此值必须传递
role_idStringbodyfalse角色 ID
variable_mapMapbodytrue变量映射关系

返回参数

参数名类型说明
variable_keyString变量键
variable_valueString变量值

请求示例

PUT: /v1.0/cloud/agent/ai/b/devices/{device_id}/agent-variables
{
  "device_id": "6c3585ebfe301b40a8u***",
  "variable_map": {
    "custom.familyName": "testFamilyName"
  }
}

返回示例

[
    {
        "effective_scope_name": "角色的记忆",
        "memory_list": [
            {
                "memory_value": "踢足球,打篮球,写代码,读书",
                "memory_name": "兴趣爱好",
                "effective_scope_name": "角色的记忆",
                "memory_key": "sys.memoryInterests",
                "effective_scope": 3
            },
            {
                "memory_value": "一百岁",
                "memory_name": "年龄",
                "effective_scope_name": "角色的记忆",
                "memory_key": "sys.memoryAge",
                "effective_scope": 3
            },
            {
                "memory_value": "七月七号",
                "memory_name": "生日",
                "effective_scope_name": "角色的记忆",
                "memory_key": "sys.memoryBirthday",
                "effective_scope": 3
            },
            {
                "memory_value": "涂小鸭",
                "memory_name": "姓名",
                "effective_scope_name": "角色的记忆",
                "memory_key": "sys.memoryUserFullName",
                "effective_scope": 3
            }
        ],
        "effective_scope": 3
    }
]

错误码

参考 错误码