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

## getPanelAgentCustomRoleDetail

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

> 💡 接口依赖云能力，需在 [小程序开发者平台](https://platform.tuya.com/miniapp/)开发设置 - 云能力 进行授权配置。

### 方法签名

```typescript
getPanelAgentCustomRoleDetail(params: GetPanelAgentCustomRoleDetailParams)
```

### 描述

查询自定义角色详情。

### 参数

`Params`

| 参数 | 类型 | 必填 | 默认值 | 描述 |
| --- | --- | --- | --- | --- |
| `params` | `GetPanelAgentCustomRoleDetailParams` | 是 | - | 请求体 |

### 返回值

类型: `Promise<PanelAgentRoleDetail>`

GetPanelAgentCustomRoleDetailResult（字段含义见类型定义与 minituya 返回参数）

### 引用对象

##### `interface` GetPanelAgentCustomRoleDetailParams

| 属性 | 类型 | 必填 | 描述 |
| --- | --- | --- | --- |
| `devId` | `string` | 是 | 设备ID |
| `roleId` | `string` | 是 | 角色ID |

##### `type` PanelAgentRoleDetail

| 属性 | 类型 | 描述 |
| --- | --- | --- |
| `roleId` | `string` | 角色id |
| `roleName` | `string` | 角色名称 |
| `roleDesc` | `string` | 角色描述 |
| `roleIntroduce` | `string` | 角色介绍 |
| `roleImgUrl` | `string` | 角色图像 |
| `useLangCode` | `string` | 角色使用语言code |
| `useLangName` | `string` | 角色使用语言名称 |
| `useTimbreId` | `string` | 角色使用音色 |
| `isUserCloneTimbre` | `boolean` | 是否是自定义克隆音色 |
| `useTimbreName` | `string` | 角色使用音色名称 |
| `useTimbreSupportLangs` | `string` | 角色支持的音色语言,多个用逗号分隔 |
| `useTimbreSupportLangList` | `string[]` | 角色支持的音色语言列表 |
| `useTimbreTags` | `string[]` | 角色标签 |
| `useLlmId` | `string` | 角色使用语言模型 |
| `useLlmName` | `string` | 角色使用语言模型名称 |
| `inBind` | `boolean` | 是否绑定 |
| `memoryInfo` | `string` | 记忆体 |
| `speed` | `number` | 音色速度 |
| `tone` | `number` | 音色语气 |
| `templateId` | `string` | 模板id |
| `bindRoleType` | `number` | 绑定角色类型 |
| `lastTextAnswer` | `string` | 最近的一次回复文本 |
| `llmSupportFuncTags` | `string` | 语言模型支持的函数标签，多个用逗号分隔 |


### 示例代码

#### 请求示例

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

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

getPanelAgentCustomRoleDetail(params)
  .then(result => {
    console.log('自定义角色详情:', result);
  })
  .catch(error => {
    console.error('获取自定义角色详情失败:', error);
  });
```

#### 返回示例

```json
{
  "roleId": "role_custom_001",
  "roleName": "智能助手小美",
  "roleDesc": "温柔贴心的智能助手",
  "roleIntroduce": "我是小美，您的专属智能助手",
  "roleImgUrl": "https://example.com/role_avatar.jpg",
  "useLangCode": "zh-CN",
  "useLangName": "中文（简体）",
  "useTimbreId": "timbre_001",
  "isUserCloneTimbre": false,
  "useTimbreName": "温柔女声",
  "useTimbreSupportLangs": "zh-CN,en-US",
  "useTimbreSupportLangList": ["zh-CN", "en-US"],
  "useTimbreTags": ["温柔", "甜美"],
  "useLlmId": "1001",
  "useLlmName": "GPT-3.5-turbo",
  "inBind": true,
  "memoryInfo": "用户喜欢温柔的语调",
  "speed": 1.0,
  "tone": 0.8,
  "templateId": "template_001",
  "bindRoleType": 0,
  "lastTextAnswer": "您好，有什么可以帮助您的吗？",
  "llmSupportFuncTags": "text,voice,image"
}
```
