Class Moderation

java.lang.Object
dev.langchain4j.model.moderation.Moderation

public class Moderation extends Object
Represents moderation status.
  • Constructor Details

    • Moderation

      public Moderation()
      Construct a Moderation object that is not flagged.
    • Moderation

      public Moderation(String flaggedText)
      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

      public String flaggedText()
      Returns the text that was flagged.
      Returns:
      the text that was flagged, or null if the text was not flagged.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • flagged

      public static Moderation flagged(String flaggedText)
      Constructs a Moderation object that is flagged.
      Parameters:
      flaggedText - the text that was flagged.
      Returns:
      a Moderation object.
    • notFlagged

      public static Moderation notFlagged()
      Constructs a Moderation object that is not flagged.
      Returns:
      a Moderation object.