mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-25 14:23:14 +00:00
Merge pull request #13914 from uc4w6c/docs/fix-custom-guardrail-imports
Fix missing and unused imports in custom_guardrail docs example
This commit is contained in:
@@ -23,15 +23,14 @@ A CustomGuardrail has 4 methods to enforce guardrails
|
||||
|
||||
Create a new file called `custom_guardrail.py` and add this code to it
|
||||
```python
|
||||
from typing import Any, Dict, List, Literal, Optional, Union
|
||||
from typing import Any, AsyncGenerator, Literal, Optional, Union
|
||||
|
||||
import litellm
|
||||
from litellm._logging import verbose_proxy_logger
|
||||
from litellm.caching.caching import DualCache
|
||||
from litellm.integrations.custom_guardrail import CustomGuardrail
|
||||
from litellm.proxy._types import UserAPIKeyAuth
|
||||
from litellm.proxy.guardrails.guardrail_helpers import should_proceed_based_on_metadata
|
||||
from litellm.types.guardrails import GuardrailEventHooks
|
||||
from litellm.types.utils import ModelResponseStream
|
||||
|
||||
|
||||
class myCustomGuardrail(CustomGuardrail):
|
||||
|
||||
Reference in New Issue
Block a user