updatePanelAgentCustomRole(params: UpdatePanelAgentCustomRoleParams)

版本要求:
@tuya-miniapp/cloud-api≥1.0.6

描述

修改自定义角色。

参数

参数类型必填说明
是请求体

返回值

类型:Promise<boolean>
UpdatePanelAgentCustomRoleResult(字段含义见类型定义与 minituya 返回参数)

示例代码

请求示例

import { updatePanelAgentCustomRole } from '@tuya-miniapp/cloud-api';

const params = {
  devId: 'your_device_id',
  roleId: 'role_custom_12345',
  roleName: '智能助手小美v2',
  roleDesc: '更加温柔贴心的智能助手',
  roleIntroduce: '我是小美,您的专属智能助手,现在更加贴心了!',
  roleVariables: {
    personality: 'very_friendly',
    expertise: 'advanced',
  },
  roleImgUrl: 'https://example.com/new_avatar.jpg',
  useLangCode: 'zh-CN',
  useTimbreId: 'timbre_002',
  useLlmId: '1002',
  memoryInfo: '用户喜欢详细的解答',
  speed: '0.9',
  tone: '0.7',
  needBind: 'true',
};

updatePanelAgentCustomRole(params)
  .then(result => {
    console.log('更新结果:', result);
  })
  .catch(error => {
    console.error('更新自定义角色失败:', error);
  });

返回示例

true