Class ModerationRequest.Builder
java.lang.Object
dev.langchain4j.model.moderation.ModerationRequest.Builder
- Enclosing class:
ModerationRequest
Builder for
ModerationRequest.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newModerationRequest.Sets the model name to use for this request.Sets the list of texts to moderate.
-
Method Details
-
texts
Sets the list of texts to moderate.- Parameters:
texts- the list of texts to moderate.- Returns:
- this builder.
-
modelName
Sets the model name to use for this request. When set, this overrides the model name configured when theModerationModelwas created.- Parameters:
modelName- the model name.- Returns:
- this builder.
-
build
Builds a newModerationRequest.- Returns:
- a new
ModerationRequest. - Throws:
IllegalArgumentException- if texts is null or empty.
-