mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-19 00:01:29 +00:00
* feat(azure): add support for Azure OpenAI v1 API When api_version is 'v1', 'latest', or 'preview', use the standard OpenAI client instead of AzureOpenAI client with base_url pointing to /openai/v1/ endpoint. This follows Microsoft's documentation for the new v1 API format: https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#api-specs Changes: - Add OpenAI/AsyncOpenAI imports to common_utils.py and azure.py - Modify get_azure_openai_client() to detect v1 API versions and create appropriate client type - Update isinstance checks and type hints to accept both client types - Add unit tests for v1 API client creation * fix(azure): fix MyPy type errors for v1 API support - Add type: ignore for AsyncOpenAI constructor - Update type hints in files/handler.py and batches/handler.py - Add OpenAI/AsyncOpenAI to Union types for client parameters - Update isinstance checks to include OpenAI/AsyncOpenAI * fix(azure): update type hints in files and batches handlers for v1 API Update async method signatures to accept Union[AsyncAzureOpenAI, AsyncOpenAI] to fix mypy errors when using v1 API client. |
||
|---|---|---|
| .. | ||
| chat | ||
| image_generation | ||
| realtime | ||
| response | ||
| text_to_speech | ||
| videos | ||
| test_azure_common_utils.py | ||
| test_azure_exception_mapping.py | ||