Class Moderation
java.lang.Object
dev.langchain4j.model.moderation.Moderation
- All Implemented Interfaces:
Serializable
Represents moderation status.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct a Moderation object that is not flagged.Moderation(@Nullable String flaggedText) Construct a Moderation object that is flagged. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanflagged()Returns true if the text was flagged.static ModerationConstructs a Moderation object that is flagged.@Nullable StringReturns the text that was flagged.inthashCode()static ModerationConstructs a Moderation object that is not flagged.toString()
-
Constructor Details
-
Moderation
public Moderation()Construct a Moderation object that is not flagged. -
Moderation
Construct a Moderation object that is flagged.- Parameters:
flaggedText- the text that was flagged.
-
-
Method Details
-
flagged
public boolean flagged()Returns true if the text was flagged.- Returns:
- true if the text was flagged, false otherwise.
-
flaggedText
Returns the text that was flagged.- Returns:
- the text that was flagged or
nullif the text was not flagged.
-
equals
-
hashCode
-
toString
-
flagged
Constructs a Moderation object that is flagged.- Parameters:
flaggedText- the text that was flagged.- Returns:
- a Moderation object.
-
notFlagged
Constructs a Moderation object that is not flagged.- Returns:
- a Moderation object.
-