Skip to main content

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

  1. Create a GetReportTagRequest object with the required type.
  2. Call the getReportTags() function using the instance of the LMChatClient class.
  3. 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:

VariableTypeDescriptionOptional
typeintType of report tags to fetch

GetReportTagResponse

List of parameters for the GetReportTagResponse class:

VariableTypeDescriptionOptional
reportTagsList<ReportTag>List of retrieved report tags✔️

ReportTag

VariableTypeDescriptionOptional
idintID of the report tag
nameStringName of the report tag