Class ModerationResult.Builder
java.lang.Object
com.tnsai.quality.security.moderation.ModerationResult.Builder
- Enclosing class:
ModerationResult
Builder for ModerationResult.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaction(ModerationResult.Action action) Sets the action.addCategory(ModerationResult.Category category, double score) Adds a category score.addFlaggedContent(String content) Adds flagged content.build()Builds the result.Sets the reason.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
action
Sets the action.- Parameters:
action- action to take- Returns:
- this builder
-
addCategory
Adds a category score.- Parameters:
category- categoryscore- confidence score- Returns:
- this builder
-
reason
Sets the reason.- Parameters:
reason- reason for action- Returns:
- this builder
-
addFlaggedContent
Adds flagged content.- Parameters:
content- flagged content snippet- Returns:
- this builder
-
build
Builds the result.- Returns:
- moderation result
-