Package dev.langchain4j.model.moderation
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 TypeMethodDescriptionboolean
boolean
flagged()
Returns true if the text was flagged.static Moderation
Constructs a Moderation object that is flagged.@Nullable String
Returns the text that was flagged.int
hashCode()
static Moderation
Constructs 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
null
if the text was not flagged.
-
equals
-
hashCode
public int 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.
-