langchain_experimental.comprehend_moderation.base_moderation.BaseModeration¶

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

Base class for moderation.

Methods

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

moderate(prompt)

Moderate the input prompt.

Parameters
  • client (Any) –

  • config (Optional[Any]) –

  • moderation_callback (Optional[Any]) –

  • unique_id (Optional[str]) –

  • run_manager (Optional[CallbackManagerForChainRun]) –

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

  • config (Optional[Any]) –

  • moderation_callback (Optional[Any]) –

  • unique_id (Optional[str]) –

  • run_manager (Optional[CallbackManagerForChainRun]) –

moderate(prompt: Any) str[source]¶

Moderate the input prompt.

Parameters

prompt (Any) –

Return type

str