ModerationResultBody class

A successful moderation result produced for a request input or output.

Inheritance
Annotations
  • @immutable

Constructors

ModerationResultBody({required String model, required bool flagged, required Map<String, bool> categories, required Map<String, double> categoryScores, required Map<String, List<ModerationInputType>> categoryAppliedInputTypes})
Creates a ModerationResultBody.
const
ModerationResultBody.fromJson(Map<String, dynamic> json)
Creates a ModerationResultBody from JSON.
factory

Properties

categories Map<String, bool>
Moderation categories mapped to whether the content is flagged.
final
categoryAppliedInputTypes Map<String, List<ModerationInputType>>
Which input modalities each category score applies to.
final
categoryScores Map<String, double>
Moderation categories mapped to confidence scores.
final
flagged bool
Whether the content was flagged by any category.
final
hashCode int
The hash code for this object.
no setteroverride
model String
The moderation model that produced this result.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type String
The discriminator type for this outcome.
no setteroverride

Methods

copyWith({String? model, bool? flagged, Map<String, bool>? categories, Map<String, double>? categoryScores, Map<String, List<ModerationInputType>>? categoryAppliedInputTypes}) ModerationResultBody
Creates a copy with the given fields replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts to JSON.
override
toString() String
A string representation of this object.
override

Operators

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