Moderation class

Represents policy compliance report by OpenAI's content moderation model against a given input.

Annotations
  • @freezed

Constructors

Moderation({required bool flagged, required ModerationCategories categories, @JsonKey.new(name: 'category_scores') required ModerationCategoriesScores categoryScores, @JsonKey.new(name: 'category_applied_input_types') required ModerationCategoriesAppliedInputTypes categoryAppliedInputTypes})
Factory constructor for Moderation
const
factory
Moderation.fromJson(Map<String, dynamic> json)
Object construction from a JSON representation
factory

Properties

categories ModerationCategories
A list of the categories, and whether they are flagged or not.
no setterinherited
categoryAppliedInputTypes ModerationCategoriesAppliedInputTypes
A list of the categories along with the input type(s) that the score applies to.
no setterinherited
categoryScores ModerationCategoriesScores
A list of the categories along with their scores as predicted by model.
no setterinherited
copyWith → $ModerationCopyWith<Moderation>
Create a copy of Moderation with the given fields replaced by the non-null parameter values.
no setterinherited
flagged bool
Whether any of the below categories are flagged.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serializes this Moderation to a JSON map.
inherited
toMap() Map<String, dynamic>
Map representation of object (not serialized)
toString() String
A string representation of this object.
inherited
validateSchema() String?
Perform validations on the schema property values

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

propertyNames → const List<String>
List of all property names of schema