Package dev.langchain4j.model.moderation
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
-
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: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 prompt.- Specified by:
moderate
in interfaceModerationModel
- Parameters:
prompt
- the prompt to moderate.- Returns:
- the moderation
Response
.
-
moderate
Description copied from interface:ModerationModel
Moderates the given chat message.- Specified by:
moderate
in interfaceModerationModel
- Parameters:
message
- the chat message 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
.
-
moderate
Description copied from interface:ModerationModel
Moderates the given text segment.- Specified by:
moderate
in interfaceModerationModel
- Parameters:
textSegment
- the text segment to moderate.- Returns:
- the moderation
Response
.
-