Class DisabledModerationModel
java.lang.Object
dev.langchain4j.model.moderation.DisabledModerationModel
- All Implemented Interfaces:
ModerationModel
A
ModerationModel which throws a ModelDisabledException for all of its methods
This could be used in tests, or in libraries that extend this one to conditionally enable or disable functionality.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoModerate(ModerationRequest moderationRequest) Performs the actual moderation.moderate(ChatMessage message) Moderates the given chat message.moderate(TextSegment textSegment) Moderates the given text segment.Moderates the given prompt.Moderates the given text.moderate(List<ChatMessage> messages) Moderates the given list of chat messages.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ModerationModel
listeners, modelName, moderate, provider
-
Constructor Details
-
DisabledModerationModel
public DisabledModerationModel()
-
-
Method Details
-
moderate
Description copied from interface:ModerationModelModerates the given text.- Specified by:
moderatein interfaceModerationModel- Parameters:
text- the text to moderate.- Returns:
- the moderation
Response.
-
moderate
Description copied from interface:ModerationModelModerates the given prompt.- Specified by:
moderatein interfaceModerationModel- Parameters:
prompt- the prompt to moderate.- Returns:
- the moderation
Response.
-
moderate
Description copied from interface:ModerationModelModerates the given chat message.- Specified by:
moderatein interfaceModerationModel- Parameters:
message- the chat message to moderate.- Returns:
- the moderation
Response.
-
moderate
Description copied from interface:ModerationModelModerates the given list of chat messages.- Specified by:
moderatein interfaceModerationModel- Parameters:
messages- the list of chat messages to moderate.- Returns:
- the moderation
Response.
-
moderate
Description copied from interface:ModerationModelModerates the given text segment.- Specified by:
moderatein interfaceModerationModel- Parameters:
textSegment- the text segment to moderate.- Returns:
- the moderation
Response.
-
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.
-