Files
litellm/tests/test_litellm/llms
jay prajapatiandGitHub 363b0cc132 fix(azure): preserve content_policy_violation details for images (#19328) (#19372)
Azure OpenAI Images (DALL·E 3) returns policy violations as a structured payload under body["error"], including inner_error.content_filter_results and revised_prompt.

LiteLLM previously:
- Failed to extract nested error messages (get_error_message only handled body["message"])
- Missed policy violation detection when error strings were generic
- Dropped inner_error details when raising ContentPolicyViolationError

This change:
- Extracts nested Azure error fields (code/type/message + inner_error)
- Detects policy violations via structured error codes
- Passes an OpenAI-style error body + provider_specific_fields to preserve details

Tests:
- python3 -m pytest tests/test_litellm/llms/azure/test_azure_exception_mapping.py
- python3 -m pytest tests/test_litellm/litellm_core_utils/test_exception_mapping_utils.py

Fixes #19328
2026-01-21 20:06:51 -08:00
..
2026-01-07 11:01:31 +05:30
2025-08-06 14:23:55 -06:00
2025-09-27 10:01:48 -07:00
2026-01-17 06:26:18 +09:00
2026-01-14 10:17:01 +05:30
2025-12-06 00:04:04 +05:30
2025-10-17 17:52:25 -07:00
2025-11-24 11:44:20 -08:00