Files
litellm/tests/test_litellm/proxy/guardrails
Krish Dholakia 42cd05dee8 Add Azure Content Safety Guardrails to LiteLLM proxy (#12268)
* feat(azure/prompt_shield.py): initial commit adding prompt shield guardrail + auto discovery mechanism for guardrails

reduces amount of code needed outside of guardrail integration for instrumentation

* feat(azure/prompt_shield.py): working azure prompt shield guardrail integration

Addresses https://github.com/BerriAI/litellm/issues/12254

* test: unit tests for prompt_shield

* fix(prompt_shield.py): add event hook validation for prompt shield guardrail

ensures prompt shield guardrail raises error if asked to run post_call (only runs on user prompt)

* feat(azure/): working text_moderation integration

* fix(text_moderation.py): suppress linting error

* test(test_azure_text_moderation.py): add unit test

* test(test_azure_text_moderation.py): add unit test for responses

* fix(text_moderation.py): return streaming error correctly

ensures error returned to user

* fix: fix linting error

* fix: fix linting check

* test: change mistral model

service tier exceeded

* fix(exception_mapping_utils.py): cover mistral in exception mapping
2025-07-02 21:34:19 -07:00
..