Class ModerationRequest

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

public class ModerationRequest extends Object
Represents a moderation request.
  • Method Details

    • texts

      public List<String> texts()
      Returns the list of texts to moderate.
      Returns:
      the list of texts to moderate.
    • modelName

      public @Nullable String modelName()
      Returns the model name to use for this request. When set, this overrides the model name configured when the ModerationModel was created.
      Returns:
      the model name, or null if not specified.
    • 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
    • toBuilder

      public ModerationRequest.Builder toBuilder()
      Converts this instance to a ModerationRequest.Builder with all of the same field values, allowing modifications to the current object's fields.
      Returns:
      a new ModerationRequest.Builder instance initialized with the current state of this ModerationRequest.
    • builder

      public static ModerationRequest.Builder builder()
      Creates a new builder.
      Returns:
      a new builder.