基础审核#

class langchain_experimental.comprehend_moderation.base_moderation.BaseModeration(client: Any, config: Any | None = None, moderation_callback: Any | None = None, unique_id: str | None = None, run_manager: CallbackManagerForChainRun | None = None)[source]#

审核的基类。

方法

__init__(client[, config, ...])

moderate(prompt)

对输入的提示进行审核。

Parameters:
  • client (Any)

  • config (任意 | )

  • moderation_callback (任意 | )

  • unique_id (str | None)

  • run_manager (CallbackManagerForChainRun | None)

__init__(client: Any, config: Any | None = None, moderation_callback: Any | None = None, unique_id: str | None = None, run_manager: CallbackManagerForChainRun | None = None)[source]#
Parameters:
  • client (Any)

  • config (任意类型 | )

  • moderation_callback (任意 | )

  • unique_id (str | None)

  • run_manager (CallbackManagerForChainRun | None)

moderate(prompt: Any) str[source]#

调整输入提示。

Parameters:

提示 (任意)

Return type:

字符串