litellm-enterprise 0.1.20__py3-none-any.whl → 0.1.21__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. litellm_enterprise/enterprise_callbacks/.pytest_cache/.gitignore +2 -0
  2. litellm_enterprise/enterprise_callbacks/.pytest_cache/CACHEDIR.TAG +4 -0
  3. litellm_enterprise/enterprise_callbacks/.pytest_cache/README.md +8 -0
  4. litellm_enterprise/enterprise_callbacks/.pytest_cache/v/cache/nodeids +1 -0
  5. litellm_enterprise/enterprise_callbacks/.pytest_cache/v/cache/stepwise +1 -0
  6. litellm_enterprise/enterprise_callbacks/generic_api_callback.py +1 -1
  7. litellm_enterprise/enterprise_callbacks/llama_guard.py +2 -10
  8. litellm_enterprise/enterprise_callbacks/llm_guard.py +2 -9
  9. litellm_enterprise/enterprise_callbacks/pagerduty/pagerduty.py +9 -12
  10. litellm_enterprise/enterprise_callbacks/send_emails/base_email.py +61 -1
  11. litellm_enterprise/integrations/custom_guardrail.py +1 -2
  12. litellm_enterprise/proxy/common_utils/check_batch_cost.py +3 -4
  13. litellm_enterprise/proxy/hooks/managed_files.py +6 -24
  14. litellm_enterprise/proxy/management_endpoints/internal_user_endpoints.py +0 -1
  15. litellm_enterprise/proxy/management_endpoints/key_management_endpoints.py +12 -0
  16. litellm_enterprise/proxy/vector_stores/endpoints.py +49 -7
  17. litellm_enterprise/types/enterprise_callbacks/send_emails.py +14 -2
  18. {litellm_enterprise-0.1.20.dist-info → litellm_enterprise-0.1.21.dist-info}/METADATA +1 -1
  19. {litellm_enterprise-0.1.20.dist-info → litellm_enterprise-0.1.21.dist-info}/RECORD +21 -18
  20. litellm_enterprise/integrations/prometheus.py +0 -2361
  21. litellm_enterprise/proxy/guardrails/endpoints.py +0 -41
  22. {litellm_enterprise-0.1.20.dist-info → litellm_enterprise-0.1.21.dist-info}/LICENSE.md +0 -0
  23. {litellm_enterprise-0.1.20.dist-info → litellm_enterprise-0.1.21.dist-info}/WHEEL +0 -0
@@ -1,41 +0,0 @@
1
- """
2
- Enterprise Guardrail Routes on LiteLLM Proxy
3
-
4
- To see all free guardrails see litellm/proxy/guardrails/*
5
-
6
-
7
- Exposed Routes:
8
- - /mask_pii
9
- """
10
- from typing import Optional
11
-
12
- from fastapi import APIRouter, Depends
13
-
14
- from litellm.integrations.custom_guardrail import CustomGuardrail
15
- from litellm.proxy._types import UserAPIKeyAuth
16
- from litellm.proxy.auth.user_api_key_auth import user_api_key_auth
17
- from litellm.proxy.guardrails.guardrail_endpoints import GUARDRAIL_REGISTRY
18
- from litellm.types.guardrails import ApplyGuardrailRequest, ApplyGuardrailResponse
19
-
20
- router = APIRouter(tags=["guardrails"], prefix="/guardrails")
21
-
22
-
23
- @router.post("/apply_guardrail", response_model=ApplyGuardrailResponse)
24
- async def apply_guardrail(
25
- request: ApplyGuardrailRequest,
26
- user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),
27
- ):
28
- """
29
- Mask PII from a given text, requires a guardrail to be added to litellm.
30
- """
31
- active_guardrail: Optional[
32
- CustomGuardrail
33
- ] = GUARDRAIL_REGISTRY.get_initialized_guardrail_callback(
34
- guardrail_name=request.guardrail_name
35
- )
36
- if active_guardrail is None:
37
- raise Exception(f"Guardrail {request.guardrail_name} not found")
38
-
39
- return await active_guardrail.apply_guardrail(
40
- text=request.text, language=request.language, entities=request.entities
41
- )