---
name: "getPanelAgentCustomRoleDetail"
mode: "api"
versionRequirements:
  - { name: "@tuya-miniapp/cloud-api", version: "1.0.6" }
---

## getPanelAgentCustomRoleDetail

> [VERSION] @tuya-miniapp/cloud-api >= 1.0.6

> 💡 This API depends on cloud capabilities. Configure authorization under Development Settings -> Cloud Capabilities on the Mini App Developer Platform (https://platform.tuya.com/miniapp/).

### Description

Get custom role details.

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `params` | `GetPanelAgentCustomRoleDetailParams` | Yes | Request body |

### Return Value

Type: `Promise<PanelAgentRoleDetail>`

GetPanelAgentCustomRoleDetailResult (see type definitions and minituya response parameters for field meanings)

##### PanelAgentRoleDetail

| Property | Type | Description |
| --- | --- | --- |
| `roleId` | `string` | Role ID |
| `roleName` | `string` | Role name |
| `roleDesc` | `string` | Role description |
| `roleIntroduce` | `string` | Role overview |
| `roleImgUrl` | `string` | Role image |
| `useLangCode` | `string` | Role language code |
| `useLangName` | `string` | Role language name |
| `useTimbreId` | `string` | Role voice |
| `isUserCloneTimbre` | `boolean` | Is custom cloned voice |
| `useTimbreName` | `string` | Role voice name |
| `useTimbreSupportLangs` | `string` | Voice languages supported by the role, separated by commas |
| `useTimbreSupportLangList` | `string[]` | List of voice languages supported by the role |
| `useTimbreTags` | `string[]` | Role tags |
| `useLlmId` | `string` | Role language model |
| `useLlmName` | `string` | Role language model name |
| `inBind` | `boolean` | Is bound |
| `memoryInfo` | `string` | Memory |
| `speed` | `number` | Voice speed |
| `tone` | `number` | Voice tone |
| `templateId` | `string` | Template ID |
| `bindRoleType` | `number` | Binding role type |
| `lastTextAnswer` | `string` | Most recent reply text |
| `llmSupportFuncTags` | `string` | Function tags supported by the language model, separated by commas |

### Referenced Types

##### `interface` GetPanelAgentCustomRoleDetailParams

| Property | Type | Description |
| --- | --- | --- |
| `devId` | `string` | Device ID |
| `roleId` | `string` | Role ID |


### Examples

#### Request example

```typescript
import { getPanelAgentCustomRoleDetail } from '@tuya-miniapp/cloud-api';

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

getPanelAgentCustomRoleDetail(params)
  .then(result => {
    console.log('Custom role details:', result);
  })
  .catch(error => {
    console.error('Failed to get custom role details:', error);
  });
```

#### Response example

```json
{
  "roleId": "role_custom_001",
  "roleName": "Smart Assistant Xiaomei",
  "roleDesc": "A gentle and caring smart assistant",
  "roleIntroduce": "I'm Xiaomei, your dedicated smart assistant",
  "roleImgUrl": "https://example.com/role_avatar.jpg",
  "useLangCode": "zh-CN",
  "useLangName": "Chinese (Simplified)",
  "useTimbreId": "timbre_001",
  "isUserCloneTimbre": false,
  "useTimbreName": "Gentle female voice",
  "useTimbreSupportLangs": "zh-CN,en-US",
  "useTimbreSupportLangList": ["zh-CN", "en-US"],
  "useTimbreTags": ["Gentle", "Sweet"],
  "useLlmId": "1001",
  "useLlmName": "GPT-3.5-turbo",
  "inBind": true,
  "memoryInfo": "The user prefers a gentle tone",
  "speed": 1.0,
  "tone": 0.8,
  "templateId": "template_001",
  "bindRoleType": 0,
  "lastTextAnswer": "Hello, how can I help you?",
  "llmSupportFuncTags": "text,voice,image"
}
```
