Package dev.langchain4j.model.moderation
Interface ModerationModel
-
- All Implemented Interfaces:
public interface ModerationModel
Represents a model that can moderate text.
-
-
Method Summary
Modifier and Type Method Description abstract Response<Moderation>
moderate(String text)
Moderates the given text. Response<Moderation>
moderate(Prompt prompt)
Moderates the given prompt. Response<Moderation>
moderate(ChatMessage message)
Moderates the given chat message. abstract Response<Moderation>
moderate(List<ChatMessage> messages)
Moderates the given list of chat messages. Response<Moderation>
moderate(TextSegment textSegment)
Moderates the given text segment. -
-
Method Detail
-
moderate
abstract Response<Moderation> moderate(String text)
Moderates the given text.
- Parameters:
text
- the text to moderate.- Returns:
the moderation
Response
.
-
moderate
Response<Moderation> moderate(Prompt prompt)
Moderates the given prompt.
- Parameters:
prompt
- the prompt to moderate.- Returns:
the moderation
Response
.
-
moderate
Response<Moderation> moderate(ChatMessage message)
Moderates the given chat message.
- Parameters:
message
- the chat message to moderate.- Returns:
the moderation
Response
.
-
moderate
abstract Response<Moderation> moderate(List<ChatMessage> messages)
Moderates the given list of chat messages.
- Parameters:
messages
- the list of chat messages to moderate.- Returns:
the moderation
Response
.
-
moderate
Response<Moderation> moderate(TextSegment textSegment)
Moderates the given text segment.
- Parameters:
textSegment
- the text segment to moderate.- Returns:
the moderation
Response
.
-
-
-
-