File tree Expand file tree Collapse file tree 4 files changed +21
-5
lines changed
lib/src/core/models/moderation Expand file tree Collapse file tree 4 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -6,21 +6,27 @@ import 'sub_models/result.dart';
66
77export 'sub_models/result.dart' ;
88
9+ /// {@template openai_moderation_model}
10+ /// This class is used to represent an OpenAI moderation job.
11+ /// {@endtemplate}
912@immutable
1013final class OpenAIModerationModel {
11- /// The ID of the moderation job.
14+ /// The [id] entifier of the moderation job.
1215 final String id;
1316
14- /// The model used for moderation.
17+ /// The [ model] used for moderation.
1518 final String model;
1619
17- /// The results of the moderation job.
20+ /// The [ results] of the moderation job.
1821 final List <OpenAIModerationResultModel > results;
1922
23+ /// Weither the moderation job have at least one result in [results] .
24+ bool get haveResults => results.isNotEmpty;
25+
2026 @override
2127 int get hashCode => id.hashCode ^ model.hashCode ^ results.hashCode;
2228
23- /// This class is used to represent an OpenAI moderation job.
29+ /// {@macro openai_moderation_model}
2430 const OpenAIModerationModel ({
2531 required this .id,
2632 required this .model,
Original file line number Diff line number Diff line change 11import 'package:meta/meta.dart' ;
22
3+ /// {@template openai_moderation_result_categories_model}
4+ /// This class is used to represent an OpenAI moderation job result categories.
5+ /// {@endtemplate}
36@immutable
47final class OpenAIModerationResultCategoriesModel {
58 /// The hate category.
@@ -56,6 +59,7 @@ final class OpenAIModerationResultCategoriesModel {
5659
5760 /// Whether the moderation request is not safe or not.
5861 bool get isNotSafe => ! isSafe;
62+
5963 @override
6064 int get hashCode {
6165 return hate.hashCode ^
Original file line number Diff line number Diff line change 11import 'package:meta/meta.dart' ;
22
3+ /// {@template openai_moderation_result_scores_model}
4+ /// This class is used to represent an OpenAI moderation job result scores.
5+ /// {@endtemplate}
36@immutable
47final class OpenAIModerationResultScoresModel {
58 /// The hate score of the moderation job.
Original file line number Diff line number Diff line change @@ -6,6 +6,9 @@ import 'catgeories_scores.dart';
66export 'catgeories.dart' ;
77export 'catgeories_scores.dart' ;
88
9+ /// {@template openai_moderation_result_model}
10+ /// This class is used to represent an OpenAI moderation job result.
11+ /// {@endtemplate}
912@immutable
1013final class OpenAIModerationResultModel {
1114 /// The categories of the moderation job.
@@ -21,7 +24,7 @@ final class OpenAIModerationResultModel {
2124 int get hashCode =>
2225 categories.hashCode ^ categoryScores.hashCode ^ flagged.hashCode;
2326
24- /// This class is used to represent an OpenAI moderation job result.
27+ /// {@macro openai_moderation_result_model}
2528 const OpenAIModerationResultModel ({
2629 required this .categories,
2730 required this .categoryScores,
You can’t perform that action at this time.
0 commit comments