litellm/tests/test_litellm/llms/azure
tin-berri 13837d319d
fix(openai): drop tool schema regex patterns OpenAI's validator cannot compile (#40485)
* fix(openai): drop tool schema regex patterns OpenAI's validator cannot compile

OpenAI validates function tool parameters with jsonschema's format checker,
which compiles every pattern with Python re. Claude Code's Artifact tool ships
an ECMA-262 pattern with \p{..} Unicode property escapes, so any OpenAI target
behind /v1/messages, /v1/responses or /v1/chat/completions 400s with
"Invalid schema for function 'Artifact': '...' is not a 'regex'" for every
model family. Drop only the patterns Python re rejects, keep the rest, at the
same seams that already flatten top-level combinators.

* fix(openai): walk only schema positions, iteratively, and drop regexes for every openai deployment

Review round: the regex sanitizer now walks JSON Schema applicator positions
only (properties, items, prefixItems, combinators, $defs, additionalProperties
and the rest), so a pattern key inside default, examples, const or a vendor
extension is data and stays. It also drops patternProperties keys Python re
cannot compile, which OpenAI checks the same way. The walk is level-order and
rebuilt deepest level first instead of recursive, so the code-quality recursion
gate passes and there is no depth cap below what a JSON parser admits. On the
chat wire an openai deployment with a custom api_base now drops such regexes
too, since that base is usually a proxy in front of the same validator, while
the lossier combinator flattening stays limited to api.openai.com hosts.
2026-09-09 22:08:30 -07:00
..
batches test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
chat fix(openai): drop tool schema regex patterns OpenAI's validator cannot compile (#40485) 2026-09-09 22:08:30 -07:00
image_edit fix(azure): honor base_url client param and drop stale api-version on v1 image routes 2026-08-26 01:49:48 +00:00
image_generation fix(azure): send the deployment name as the body model on v1 image routes 2026-08-29 11:41:58 -07:00
passthrough fix(azure): keep the model group segment exact and casefold only deployment names in the relay guard 2026-09-08 17:19:23 -07:00
realtime refactor(azure/realtime): keep auth header build within lint budgets after merge 2026-08-25 17:32:21 +00:00
response fix(openai): drop tool schema regex patterns OpenAI's validator cannot compile (#40485) 2026-09-09 22:08:30 -07:00
search fix(azure/search): reject bool and non-positive max_results for bing_grounding count 2026-08-24 12:53:44 -07:00
text_to_speech style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
videos test(lint): ban blind pytest.raises(Exception) with ruff B017 (#37731) 2026-08-20 18:09:42 -07:00
test_audio_transcriptions.py fix(azure): price azure_ai transcriptions at the azure_ai cost-map entry 2026-09-08 17:12:18 -07:00
test_azure_common_utils.py fix(azure): default max_retries to DEFAULT_MAX_RETRIES with regression tests 2026-09-09 14:29:06 -07:00
test_azure_cost_calculation.py fix(cost): pass service_tier through azure and azure_ai cost calculation (#24926) 2026-05-01 17:26:45 +05:30
test_azure_embedding.py test: run the 30 test files stranded in the second mirror (#37595) 2026-08-20 10:59:43 -07:00
test_azure_exception_mapping.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_azure_fine_tuning_api.py refactor: refactor testing 2026-03-28 18:39:32 -07:00
test_azure_speech_audio_transcription.py feat(azure): add speech transcription config support (#27482) 2026-05-23 12:16:01 -07:00