Class OpenAiModerationModel

java.lang.Object
dev.langchain4j.model.openai.OpenAiModerationModel
All Implemented Interfaces:
dev.langchain4j.model.moderation.ModerationModel

public class OpenAiModerationModel extends Object implements dev.langchain4j.model.moderation.ModerationModel
Represents an OpenAI moderation model, such as text-moderation-latest.
  • Constructor Details

  • Method Details

    • modelName

      public String modelName()
    • moderate

      public dev.langchain4j.model.output.Response<dev.langchain4j.model.moderation.Moderation> moderate(String text)
      Specified by:
      moderate in interface dev.langchain4j.model.moderation.ModerationModel
    • moderate

      public dev.langchain4j.model.output.Response<dev.langchain4j.model.moderation.Moderation> moderate(List<dev.langchain4j.data.message.ChatMessage> messages)
      Specified by:
      moderate in interface dev.langchain4j.model.moderation.ModerationModel
    • withApiKey

      @Deprecated public static OpenAiModerationModel withApiKey(String apiKey)
      Deprecated.
      use builder() instead and explicitly set the model name and, if required, other parameters.
    • builder