Fetch Report Tags
The getReportTags() method is used to retrieve a list of report tags. These tags can be utilized for reporting specific content or behavior, aiding in moderation and content management.
Steps to Retrieve Report Tags
- Create a
GetReportTagRequestobject with the required type. - Call the
getReportTags()function using the instance of theLMChatClientclass. - Use the response LMResponse<
GetReportTagResponse> to fetch the list of report tags.
GetReportTagRequest request = (GetReportTagRequestBuilder()
..type(1)) // Provide the type
.build();
final LMResponse<GetReportTagResponse> response = await lmChatClient.getReportTags(request);
if (response.success) {
// Use the retrieved report tags
handleReportTags(response.data.reportTags);
} else {
// Handle error
handleError(response);
}
tip
The type parameter helps categorize and fetch specific types of report tags. Ensure you provide a valid type as per your application's context.
Models
GetReportTagRequest
List of parameters for the GetReportTagRequest class:
| Variable | Type | Description | Optional |
|---|---|---|---|
type | int | Type of report tags to fetch |
GetReportTagResponse
List of parameters for the GetReportTagResponse class:
| Variable | Type | Description | Optional |
|---|---|---|---|
reportTags | List<ReportTag> | List of retrieved report tags | ✔️ |
ReportTag
| Variable | Type | Description | Optional |
|---|---|---|---|
id | int | ID of the report tag | |
name | String | Name of the report tag |