Interface ModerationModel

All Known Implementing Classes:
DisabledModerationModel, MistralAiModerationModel, OpenAiModerationModel

public interface ModerationModel
Represents a model that can moderate text.
  • Method Details

    • moderate

      Response<Moderation> moderate(String text)
      Moderates the given text.
      Parameters:
      text - the text to moderate.
      Returns:
      the moderation Response.
    • moderate

      default Response<Moderation> moderate(Prompt prompt)
      Moderates the given prompt.
      Parameters:
      prompt - the prompt to moderate.
      Returns:
      the moderation Response.
    • moderate

      default Response<Moderation> moderate(ChatMessage message)
      Moderates the given chat message.
      Parameters:
      message - the chat message to moderate.
      Returns:
      the moderation Response.
    • moderate

      Response<Moderation> moderate(List<ChatMessage> messages)
      Moderates the given list of chat messages.
      Parameters:
      messages - the list of chat messages to moderate.
      Returns:
      the moderation Response.
    • moderate

      default Response<Moderation> moderate(TextSegment textSegment)
      Moderates the given text segment.
      Parameters:
      textSegment - the text segment to moderate.
      Returns:
      the moderation Response.