Toggle Menu
Prev Up Next

# `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)

  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)
    Parameters

      - client (Any) –

      - config (Optional[Any]) –

      - moderation_callback (Optional[Any]) –

      - unique_id (Optional[str]) –

      - run_manager (Optional[CallbackManagerForChainRun]) –

  moderate(prompt: Any) → str

    Moderate the input prompt.

    Parameters

      prompt (Any) –

    Return type

      str