initializePanelAgentRoleBinding(params: InitializePanelAgentRoleBindingParams)

Requires:
@tuya-miniapp/cloud-api≥1.0.6

Description

Initialize role-agent binding.

Parameters

ParameterTypeRequiredDescription
YesRequest body

Return Value

Type: Promise<PanelAgentRoleDetail>
InitializePanelAgentRoleBindingResult (see type definitions and minituya response parameters for field meanings)

Referenced Types

typePanelAgentRoleDetail
PropertyTypeDescription
roleIdstringRole ID
roleNamestringRole name
roleDescstringRole description
roleIntroducestringRole description
roleImgUrlstringRole image
useLangCodestringRole language code
useLangNamestringRole language name
useTimbreIdstringVoice used by the role
isUserCloneTimbrebooleanWhether it is a custom cloned voice
useTimbreNamestringName of the voice used by the role
useTimbreSupportLangsstringLanguages supported by the role's voice, separated by commas
useTimbreSupportLangListstring[]List of languages supported by the role's voice
useTimbreTagsstring[]Role tags
useLlmIdstringRole language model
useLlmNamestringRole language model name
inBindbooleanWhether bound
memoryInfostringMemory
speednumberVoice speed
tonenumberVoice tone
templateIdstringTemplate ID
bindRoleTypenumberType of bound role
lastTextAnswerstringMost recent reply text
llmSupportFuncTagsstringFunction tags supported by the language model, separated by commas

Examples

Request example

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

const params = {
  devId: 'your_device_id',
};

initializePanelAgentRoleBinding(params)
  .then(result => {
    console.log('Initialization result:', result);
  })
  .catch(error => {
    console.error('Failed to initialize binding relationship:', error);
  });

Response example

{
  "roleId": "role_initialized_001",
  "roleName": "Initialized smart assistant",
  "roleDesc": "Default smart assistant initialized by the system",
  "roleIntroduce": "I am the smart assistant initialized by the system for you",
  "roleImgUrl": "https://example.com/default_avatar.jpg",
  "useLangCode": "zh-CN",
  "useLangName": "Chinese (Simplified)",
  "useTimbreId": "timbre_default_001",
  "isUserCloneTimbre": false,
  "useTimbreName": "Default timbre",
  "useTimbreSupportLangs": "zh-CN",
  "useTimbreSupportLangList": ["zh-CN"],
  "useTimbreTags": ["Default", "Initial"],
  "useLlmId": "1001",
  "useLlmName": "GPT-3.5-turbo",
  "inBind": true,
  "memoryInfo": "Initialization memory info",
  "speed": 1.0,
  "tone": 0.5,
  "templateId": "default_template",
  "bindRoleType": 2,
  "lastTextAnswer": "Hello, I am your smart assistant. Glad to serve you!",
  "llmSupportFuncTags": "text"
}