Package dev.langchain4j.model.moderation
Class Moderation
-
- All Implemented Interfaces:
public class ModerationRepresents moderation status.
-
-
Constructor Summary
Constructors Constructor Description Moderation()Construct a Moderation object that is not flagged. Moderation(String flaggedText)Construct a Moderation object that is flagged.
-
Method Summary
Modifier and Type Method Description booleanflagged()Returns true if the text was flagged. StringflaggedText()Returns the text that was flagged. booleanequals(Object o)inthashCode()StringtoString()static Moderationflagged(String flaggedText)Constructs a Moderation object that is flagged. static ModerationnotFlagged()Constructs a Moderation object that is not flagged. -
-
Constructor Detail
-
Moderation
Moderation()
Construct a Moderation object that is not flagged.
-
Moderation
Moderation(String flaggedText)
Construct a Moderation object that is flagged.- Parameters:
flaggedText- the text that was flagged.
-
-
Method Detail
-
flagged
boolean flagged()
Returns true if the text was flagged.
- Returns:
true if the text was flagged, false otherwise.
-
flaggedText
String flaggedText()
Returns the text that was flagged.
- Returns:
the text that was flagged, or null if the text was not flagged.
-
hashCode
int hashCode()
-
flagged
static Moderation flagged(String flaggedText)
Constructs a Moderation object that is flagged.
- Parameters:
flaggedText- the text that was flagged.- Returns:
a Moderation object.
-
notFlagged
static Moderation notFlagged()
Constructs a Moderation object that is not flagged.
- Returns:
a Moderation object.
-
-
-
-