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

## getPanelAgentRoleTemplateDetail

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

> 💡 This API relies on cloud capabilities; authorize it under Development Settings - Cloud Capabilities in the [Mini App Developer Platform](https://platform.tuya.com/miniapp/).

### Description

Query role template details.

### Parameters

`Params`

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

### Return Value

Type: `Promise<PanelAgentRoleDetail>`

GetPanelAgentRoleTemplateDetailResult (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 introduction |
| `roleImgUrl` | `string` | Role image |
| `useLangCode` | `string` | Role language code |
| `useLangName` | `string` | Role language name |
| `useTimbreId` | `string` | Role voice |
| `isUserCloneTimbre` | `boolean` | Whether it is a 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` | Whether bound |
| `memoryInfo` | `string` | Memory |
| `speed` | `number` | Voice speed |
| `tone` | `number` | Voice tone |
| `templateId` | `string` | Template ID |
| `bindRoleType` | `number` | Role binding type |
| `lastTextAnswer` | `string` | Most recent reply text |
| `llmSupportFuncTags` | `string` | Function tags supported by the language model, separated by commas |

### Referenced Types

##### `interface` GetPanelAgentRoleTemplateDetailParams

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


### Examples

#### Request example

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

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

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

#### Response example

```json
{
  "roleId": "template_role_001",
  "roleName": "Smart Assistant Template",
  "roleDesc": "Standard smart assistant template",
  "roleIntroduce": "I am a general-purpose smart assistant template",
  "roleImgUrl": "https://example.com/template_avatar.jpg",
  "useLangCode": "zh-CN",
  "useLangName": "Chinese (Simplified)",
  "useTimbreId": "timbre_template_001",
  "isUserCloneTimbre": false,
  "useTimbreName": "Standard female voice",
  "useTimbreSupportLangs": "zh-CN,en-US",
  "useTimbreSupportLangList": ["zh-CN", "en-US"],
  "useTimbreTags": ["Standard", "General"],
  "useLlmId": "1001",
  "useLlmName": "GPT-3.5-turbo",
  "inBind": false,
  "memoryInfo": "Default template memory",
  "speed": 1.0,
  "tone": 0.5,
  "templateId": "template_001",
  "bindRoleType": 1,
  "lastTextAnswer": "",
  "llmSupportFuncTags": "text,voice"
}
```
