更新画像模板的名称、描述或策略版本
更新画像模板。修改 plan_version 后,新写入的记忆遵循新策略版本规则,已写入的记忆不受影响。
请求体必须至少包含 name、description、plan_version、extract_scene 或 attributes_operations 中的一项。
接口
PATCH
https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v2/apps/memory/profile_schemas/{profile_schema_id}调用时请将 {WorkspaceId} 替换为真实的业务空间 ID。
路径参数
profile_schema_idstring必填画像模板 ID
请求体
namestring可选更新后的模板名称,最多 32 个字符
descriptionstring可选更新后的模板描述
plan_versionstring可选收费计划:pro 或 lite
extract_scenestring可选提取场景:efficient 或 intelligent
attributes_operationsarray可选属性变更操作列表
attributes_operations[].opstring必填操作类型:add、update 或 delete
attributes_operations[].namestring条件必填属性名称;op=add 时必填,op=update 时可选
attributes_operations[].descriptionstring可选属性描述;适用于 add 和 update
attributes_operations[].default_valuestring可选属性默认值;op=update 时可更新
attributes_operations[].attribute_idstring条件必填属性 ID;op=update 或 op=delete 时必填
memory_library_idstring可选记忆库 ID
请求示例
curl -X PATCH "https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v2/apps/memory/profile_schemas/{profile_schema_id}" \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"name": "更新后的用户基础画像",
"description": "包含用户的稳定属性和偏好信息",
"plan_version": "lite",
"extract_scene": "intelligent",
"attributes_operations": [
{"op": "add", "name": "喜欢的音乐", "description": "用户喜欢的音乐类型"},
{"op": "update", "attribute_id": "attr_002", "name": "常用运动", "default_value": "跑步"},
{"op": "delete", "attribute_id": "attr_003"}
]
}'
响应示例
{
"request_id": "813e8d62-062c-97d5-877b-e10f356ca7d4"
}
该文章对您有帮助吗?