Package com.aispect.agents.security
Class ContentModerationAgent
java.lang.Object
com.aispect.agent.core.AbstractUnitAgent<Object,Object>
com.aispect.agents.security.ContentModerationAgent
- All Implemented Interfaces:
AiAgentFilter,AiExceptionProxy<Object,,Object> AiExecutionProxy<Object,,Object> AiPostExecutionProxy<Object,,Object> AiPreExecutionProxy<Object>,AiUnitAgentHandler<Object,Object>
Content moderation Agent。
Intercept the request before the actual method is executed, and use AI Conduct safety checks (eg: pornography, violence, hate speech). If a violation is detected, an exception will be thrown to block the execution flow.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidParameter review is performed before the target method is executed.Methods inherited from class com.aispect.agent.core.AbstractUnitAgent
doFilter, execute, getAiOperations, onException, postExecute, shouldProcess
-
Constructor Details
-
ContentModerationAgent
public ContentModerationAgent()
-
-
Method Details
-
preExecute
Parameter review is performed before the target method is executed.- Specified by:
preExecutein interfaceAiPreExecutionProxy<Object>- Overrides:
preExecutein classAbstractUnitAgent<Object,Object> - Parameters:
ctx- AI Execution context, containing all parameters of the target method- Throws:
AiSpectException- Thrown when unsafe content is detected AiAgentExecutionException abnormal, or in AI Another error occurred during the call
-