mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-07 02:59:05 +00:00
azure_client_params
This commit is contained in:
parent
99a61c8c55
commit
5756c125bf
3 changed files with 13 additions and 0 deletions
BIN
flux2_test_image.png
Normal file
BIN
flux2_test_image.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 172 KiB |
|
|
@ -990,6 +990,10 @@ class AzureChatCompletion(BaseAzureLLM, BaseLLM):
|
|||
def create_azure_base_url(
|
||||
self, azure_client_params: dict, model: Optional[str]
|
||||
) -> str:
|
||||
from litellm.llms.azure_ai.image_generation import (
|
||||
AzureFoundryFluxImageGenerationConfig,
|
||||
)
|
||||
|
||||
api_base: str = azure_client_params.get(
|
||||
"azure_endpoint", ""
|
||||
) # "https://example-endpoint.openai.azure.com"
|
||||
|
|
@ -999,6 +1003,15 @@ class AzureChatCompletion(BaseAzureLLM, BaseLLM):
|
|||
if model is None:
|
||||
model = ""
|
||||
|
||||
# Handle FLUX 2 models on Azure AI which use a different URL pattern
|
||||
# e.g., /providers/blackforestlabs/v1/flux-2-pro instead of /openai/deployments/{model}/images/generations
|
||||
if AzureFoundryFluxImageGenerationConfig.is_flux2_model(model):
|
||||
return AzureFoundryFluxImageGenerationConfig.get_flux2_image_generation_url(
|
||||
api_base=api_base,
|
||||
model=model,
|
||||
api_version=api_version,
|
||||
)
|
||||
|
||||
if "/openai/deployments/" in api_base:
|
||||
base_url_with_deployment = api_base
|
||||
else:
|
||||
|
|
|
|||
BIN
test_image_edit.png
Normal file
BIN
test_image_edit.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 70 B |
Loading…
Add table
Reference in a new issue