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

## getPanelAgentMemoryList

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

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

### 描述

查询角色记忆列表。

### 参数

`Params`

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

### 引用对象

##### `interface` GetPanelAgentMemoryListParams

| 属性 | 类型 | 描述 |
| --- | --- | --- |
| `devId` | `string` | 设备ID |
| `bindRoleType` | `0 \| 1 \| 2` | 0-自定义智能体角色,1-智能体角色模板,2-单角色场景默认角色 |
| `roleId` | `string` | 角色ID（会根据bindRoleType决定具体含义） |

##### `type` PanelAgentMemoryItem

| 属性 | 类型 | 描述 |
| --- | --- | --- |
| `memoryKey` | `string` | 记忆key |
| `memoryValue` | `string` | 记忆值 |
| `memoryName` | `string` | 记忆名称 |
| `effectiveScope` | `number` | 记忆作用域 |
| `effectiveScopeName` | `string` | 记忆作用域名称 |


### 示例代码

#### 请求示例

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

const params = {
  devId: 'your_device_id',
  bindRoleType: 0,
  roleId: 'role_12345',
};

getPanelAgentMemoryList(params)
  .then(result => {
    console.log('记忆列表:', result);
  })
  .catch(error => {
    console.error('获取记忆列表失败:', error);
  });
```

#### 返回示例

```json
[
  {
    "effectiveScope": 1,
    "effectiveScopeName": "全局记忆",
    "memoryList": [
      {
        "memoryKey": "user_preference",
        "memoryValue": "喜欢蓝色",
        "memoryName": "用户偏好",
        "effectiveScope": 1,
        "effectiveScopeName": "全局记忆"
      }
    ]
  }
]
```
