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 TypeMethodDescriptionmoderate(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.
-
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.
-