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
-
Constructor Summary
-
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) Deprecated, for removal: This API element is subject to removal in a future version.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
Deprecated, for removal: This API element is subject to removal in a future version.Please usebuilder()
instead, and explicitly set the model name and, if necessary, other parameters. The default value for the model name will be removed in future releases! -
builder
-
builder()
instead, and explicitly set the model name and, if necessary, other parameters.