deletePanelAgentChatHistory(params: DeletePanelAgentChatHistoryParams)

Requires:
@tuya-miniapp/cloud-api≥1.0.6

Description

Delete role chat history.

Parameters

ParameterTypeRequiredDescription
YesRequest body

Return Value

Type: Promise<boolean>
DeletePanelAgentChatHistoryResult (See type definitions and minituya return parameters for field meanings)

Valid Values

DeletePanelAgentChatHistoryParams.bindRoleType
ValueDescriptionSince
0--
1--
2--

Examples

Request example

import { deletePanelAgentChatHistory } from '@tuya-miniapp/cloud-api';

// Delete specified records
const params1 = {
  devId: 'your_device_id',
  bindRoleType: 0,
  roleId: 'role_12345',
  clearAllHistory: false,
  requestIds: 'req_001,req_002,req_003',
};

// Clear all history
const params2 = {
  devId: 'your_device_id',
  bindRoleType: 0,
  roleId: 'role_12345',
  clearAllHistory: true,
};

deletePanelAgentChatHistory(params1)
  .then(result => {
    console.log('Delete result:', result);
  })
  .catch(error => {
    console.error('Failed to delete chat history:', error);
  });

Response example

true