Package dev.langchain4j.model.openai
Class OpenAiModerationModel
java.lang.Object
dev.langchain4j.model.openai.OpenAiModerationModel
- All Implemented Interfaces:
ModerationModel
Represents an OpenAI moderation model, such as text-moderation-latest.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Moderates the given text.moderate
(List<ChatMessage> messages) Moderates the given list of chat messages.static OpenAiModerationModel
withApiKey
(String apiKey) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.langchain4j.model.moderation.ModerationModel
moderate, moderate, moderate
-
Constructor Details
-
OpenAiModerationModel
-
-
Method Details
-
modelName
-
moderate
Description copied from interface:ModerationModel
Moderates the given text.- Specified by:
moderate
in interfaceModerationModel
- Parameters:
text
- the text to moderate.- Returns:
- the moderation
Response
.
-
moderate
Description copied from interface:ModerationModel
Moderates the given list of chat messages.- Specified by:
moderate
in interfaceModerationModel
- Parameters:
messages
- the list of chat messages to moderate.- Returns:
- the moderation
Response
.
-
withApiKey
-
builder
-