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

## getPanelAgentChatSummary

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

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

### Description

Query role chat summary.

### Parameters

`Params`

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

### Return Value

Type: `Promise<string>`

GetPanelAgentChatSummaryResult (See type definitions and minituya return parameters for field meanings)

### Referenced Types

##### `interface` GetPanelAgentChatSummaryParams

| Property | Type | Description |
| --- | --- | --- |
| `devId` | `string` | Device ID |
| `bindRoleType` | `0 \| 1 \| 2` | 0 - custom agent role, 1 - agent role template, 2 - default role in a single-role scenario |
| `roleId` | `string` | Role ID (its meaning depends on bindRoleType) |


### Examples

#### Request example

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

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

getPanelAgentChatSummary(params)
  .then(result => {
    console.log('Chat summary:', result);
  })
  .catch(error => {
    console.error('Failed to get chat summary:', error);
  });
```

#### Response example

```json
"The user asked about the weather, and the agent provided an accurate forecast. The user was satisfied with the service."
```
