langchain_experimental.comprehend_moderation.base_moderation_callbacks.BaseModerationCallbackHandler¶

class langchain_experimental.comprehend_moderation.base_moderation_callbacks.BaseModerationCallbackHandler[source]¶

Attributes

pii_callback

prompt_safety_callback

toxicity_callback

Methods

__init__()

on_after_pii(moderation_beacon, unique_id, ...)

Run after PII validation is complete.

on_after_prompt_safety(moderation_beacon, ...)

Run after Prompt Safety validation is complete.

on_after_toxicity(moderation_beacon, ...)

Run after Toxicity validation is complete.

__init__() None[source]¶
async on_after_pii(moderation_beacon: Dict[str, Any], unique_id: str, **kwargs: Any) None[source]¶

Run after PII validation is complete.

async on_after_prompt_safety(moderation_beacon: Dict[str, Any], unique_id: str, **kwargs: Any) None[source]¶

Run after Prompt Safety validation is complete.

async on_after_toxicity(moderation_beacon: Dict[str, Any], unique_id: str, **kwargs: Any) None[source]¶

Run after Toxicity validation is complete.