import { addPanelAgentCustomRole } from '@tuya-miniapp/cloud-api';
const params = {
devId: 'your_device_id',
roleName: '智能助手小美',
roleDesc: '温柔贴心的智能助手',
roleIntroduce: '我是小美,您的专属智能助手,很高兴为您服务!',
roleVariables: {
personality: 'friendly',
expertise: 'general',
},
roleImgUrl: 'https://example.com/avatar.jpg',
useLangCode: 'zh-CN',
useTimbreId: 'timbre_001',
useLlmId: '1001',
speed: '1.0',
tone: 'gentle',
};
addPanelAgentCustomRole(params)
.then(result => {
console.log('创建成功,角色ID:', result);
})
.catch(error => {
console.error('创建自定义角色失败:', error);
});