langchain_experimental.comprehend_moderation.base_moderation_callbacks
.BaseModerationCallbackHandler¶
- class langchain_experimental.comprehend_moderation.base_moderation_callbacks.BaseModerationCallbackHandler[source]¶
审核回调处理器的基类。
属性
pii_callback
prompt_safety_callback
toxicity_callback
方法
__init__
()on_after_pii
(moderation_beacon, unique_id, ...)PII验证完成后运行。
on_after_prompt_safety
(moderation_beacon, ...)Prompt Safety验证完成后运行。
on_after_toxicity
(moderation_beacon, ...)毒性验证完成后运行。
- async on_after_pii(moderation_beacon: Dict[str, Any], unique_id: str, **kwargs: Any) None [source]¶
PII验证完成后运行。
- 参数
moderation_beacon (Dict[str, Any]) –
unique_id (str) –
kwargs (Any) –
- 返回类型
None