mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-11 22:51:28 +00:00
add new GuardrailItem type
This commit is contained in:
parent
50443d3d48
commit
a2b6baab16
1 changed files with 22 additions and 0 deletions
22
litellm/types/guardrails.py
Normal file
22
litellm/types/guardrails.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
from typing import Dict, List, Optional, TypedDict, Union
|
||||
|
||||
from pydantic import BaseModel, RootModel
|
||||
|
||||
"""
|
||||
Pydantic object defining how to set guardrails on litellm proxy
|
||||
|
||||
litellm_settings:
|
||||
guardrails:
|
||||
- prompt_injection:
|
||||
callbacks: [lakera_prompt_injection, prompt_injection_api_2]
|
||||
default_on: true
|
||||
- detect_secrets:
|
||||
callbacks: [hide_secrets]
|
||||
default_on: true
|
||||
"""
|
||||
|
||||
|
||||
class GuardrailItem(BaseModel):
|
||||
callbacks: List[str]
|
||||
default_on: bool
|
||||
guardrail_name: str
|
||||
Loading…
Add table
Reference in a new issue