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
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionbuilder()doModerate(ModerationRequest moderationRequest) Performs the actual moderation.Returns the list of listeners for this moderation model.Returns the model name for this moderation model.provider()Returns the model provider for this moderation model.
-
Constructor Details
-
OpenAiModerationModel
-
-
Method Details
-
modelName
Description copied from interface:ModerationModelReturns the model name for this moderation model.- Specified by:
modelNamein interfaceModerationModel- Returns:
- the model name, or
nullif not available.
-
listeners
Description copied from interface:ModerationModelReturns the list of listeners for this moderation model.- Specified by:
listenersin interfaceModerationModel- Returns:
- the list of listeners, or an empty list if none are registered.
-
provider
Description copied from interface:ModerationModelReturns the model provider for this moderation model.- Specified by:
providerin interfaceModerationModel- Returns:
- the model provider.
-
doModerate
Description copied from interface:ModerationModelPerforms the actual moderation. This method should be overridden by implementations.- Specified by:
doModeratein interfaceModerationModel- Parameters:
moderationRequest- the moderation request.- Returns:
- the moderation response.
-
builder
-