Interface ModerationModelListener


public interface ModerationModelListener
A ModerationModel listener that listens for requests, responses and errors.
  • Method Details

    • onRequest

      default void onRequest(ModerationModelRequestContext requestContext)
      This method is called before the request is sent to the moderation model.
      Parameters:
      requestContext - The request context. It contains the ModerationRequest and attributes. The attributes can be used to pass data between methods of this listener or between multiple listeners.
    • onResponse

      default void onResponse(ModerationModelResponseContext responseContext)
      This method is called after the response is received from the model.
      Parameters:
      responseContext - The response context. It contains ModerationResponse, corresponding ModerationRequest and attributes. The attributes can be used to pass data between methods of this listener or between multiple listeners.
    • onError

      default void onError(ModerationModelErrorContext errorContext)
      This method is called when an error occurs during interaction with the model.
      Parameters:
      errorContext - The error context. It contains the error, corresponding ModerationRequest and attributes. The attributes can be used to pass data between methods of this listener or between multiple listeners.