mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-06 08:16:43 +00:00
fix: fix error on main
This commit is contained in:
parent
a6c8a40c86
commit
575e360a60
2 changed files with 6 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue