Guardrails
OpenAIModerationGuardrail
Guardrail that flags or blocks input using OpenAI’s moderation API.
Was this page helpful?
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Guardrail that flags or blocks input using OpenAI’s moderation API.
| Parameter | Type | Default | Description |
|---|---|---|---|
moderation_model | str | "omni-moderation-latest" | The model to use for moderation. |
raise_for_categories | Optional[List[str]] | None | The categories to raise for. When None, any flagged category raises. |
api_key | Optional[str] | None | The API key to use for moderation. Defaults to the OPENAI_API_KEY environment variable. |
Was this page helpful?