mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-24 04:28:37 +00:00
fix: fix error on main
This commit is contained in:
@@ -59,7 +59,7 @@ class AzureTextCompletion(BaseAzureLLM):
|
||||
|
||||
### CHECK IF CLOUDFLARE AI GATEWAY ###
|
||||
### if so - set the model as part of the base url
|
||||
if "gateway.ai.cloudflare.com" in api_base:
|
||||
if api_base is not None and "gateway.ai.cloudflare.com" in api_base:
|
||||
## build base url - assume api base includes resource name
|
||||
client = self._init_azure_client_for_cloudflare_ai_gateway(
|
||||
api_key=api_key,
|
||||
|
||||
@@ -1537,6 +1537,11 @@ def completion( # type: ignore # noqa: PLR0915
|
||||
|
||||
api_base = api_base or litellm.api_base or get_secret_str("AZURE_API_BASE")
|
||||
|
||||
if api_base is None:
|
||||
raise ValueError(
|
||||
"api_base is required for Azure OpenAI LLM provider. Either set it dynamically or set the AZURE_API_BASE environment variable."
|
||||
)
|
||||
|
||||
api_version = (
|
||||
api_version
|
||||
or litellm.api_version
|
||||
|
||||
Reference in New Issue
Block a user