From a2b6baab161bf86b8e3fc1934b24845a7b12cb70 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 3 Jul 2024 14:03:34 -0700 Subject: [PATCH] add new GuardrailItem type --- litellm/types/guardrails.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 litellm/types/guardrails.py diff --git a/litellm/types/guardrails.py b/litellm/types/guardrails.py new file mode 100644 index 00000000000..7dd06a79b17 --- /dev/null +++ b/litellm/types/guardrails.py @@ -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