Class ModerationPrompt
java.lang.Object
org.springframework.ai.moderation.ModerationPrompt
- All Implemented Interfaces:
ModelRequest<ModerationMessage>
Represents a prompt for moderation containing a single message and the options for the
moderation model. This class offers constructors to create a prompt from a single
message or a simple instruction string, allowing for customization of moderation
options through `ModerationOptions`. It simplifies creating moderation requests for
different use cases.
- Since:
- 1.0.0
- Author:
- Ahmed Yousri
-
Constructor Summary
ConstructorDescriptionModerationPrompt
(String instructions) ModerationPrompt
(String instructions, ModerationOptions moderationOptions) ModerationPrompt
(ModerationMessage message, ModerationOptions moderationModelOptions) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Retrieves the instructions or input required by the AI model.Retrieves the customizable options for AI model interactions.int
hashCode()
void
setOptions
(ModerationOptions moderationModelOptions) toString()
-
Constructor Details
-
ModerationPrompt
-
ModerationPrompt
-
ModerationPrompt
-
-
Method Details
-
getInstructions
Description copied from interface:ModelRequest
Retrieves the instructions or input required by the AI model.- Specified by:
getInstructions
in interfaceModelRequest<ModerationMessage>
- Returns:
- the instructions or input required by the AI model
-
getOptions
Description copied from interface:ModelRequest
Retrieves the customizable options for AI model interactions.- Specified by:
getOptions
in interfaceModelRequest<ModerationMessage>
- Returns:
- the customizable options for AI model interactions
-
setOptions
-
toString
-
equals
-
hashCode
public int hashCode()
-