Skip to main content
用户画像

创建画像模板

创建用户画像模板,定义画像字段

创建用户画像模板,定义画像包含的字段及描述。

请求方法与路径

POST https://dashscope.aliyuncs.com/api/v2/apps/memory/profile_schemas

请求参数

参数类型必填位置说明
namestring是Body画像模板名称,最多 32 个字符
descriptionstring否Body画像模板描述
plan_versionstring否Body收费计划:pro 或 lite
extract_scenestring否Body提取场景:efficient 或 intelligent,默认 efficient
attributesarray是Body画像属性定义列表,不能为空数组
attributes[].namestring是Body属性名称
attributes[].descriptionstring否Body属性描述
memory_library_idstring否Body记忆库 ID,不传则使用默认记忆库

代码示例

curl -X POST https://dashscope.aliyuncs.com/api/v2/apps/memory/profile_schemas \
  --header "Authorization: Bearer $DASHSCOPE_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "name": "用户基础画像",
    "description": "包含年龄和兴趣的用户信息",
    "extract_scene": "efficient",
    "attributes": [
      {"name": "年龄", "description": "用户年龄"},
      {"name": "爱好", "description": "用户的兴趣爱好"},
      {"name": "职业", "description": "用户职业"}
    ]
  }'

响应示例

{
  "profile_schema_id": "50edf54eaa5842e891d959ae115205be",
  "request_id": "f190a540-814e-9c1c-873e-0661851c8fca"
}
创建后,使用 AddMemory 传入 profile_schema 提取画像,再用 GetUserProfile 获取。
Managed Agents
Sandbox
Security
RAG
应用调用
ParseX
框架