Package dev.langchain4j.model.moderation
Interface ModerationModel
- All Known Implementing Classes:
DisabledModerationModel
,MistralAiModerationModel
,OpenAiModerationModel
public interface ModerationModel
Represents a model that can moderate text.
-
Method Summary
Modifier and TypeMethodDescriptiondefault Response
<Moderation> moderate
(ChatMessage message) Moderates the given chat message.default Response
<Moderation> moderate
(TextSegment textSegment) Moderates the given text segment.default Response
<Moderation> Moderates the given prompt.Moderates the given text.moderate
(List<ChatMessage> messages) Moderates the given list of chat messages.
-
Method Details
-
moderate
Moderates the given text.- Parameters:
text
- the text to moderate.- Returns:
- the moderation
Response
.
-
moderate
Moderates the given prompt.- Parameters:
prompt
- the prompt to moderate.- Returns:
- the moderation
Response
.
-
moderate
Moderates the given chat message.- Parameters:
message
- the chat message to moderate.- Returns:
- the moderation
Response
.
-
moderate
Moderates the given list of chat messages.- Parameters:
messages
- the list of chat messages to moderate.- Returns:
- the moderation
Response
.
-
moderate
Moderates the given text segment.- Parameters:
textSegment
- the text segment to moderate.- Returns:
- the moderation
Response
.
-