forked from phoenix/litellm-mirror
fix(router.py): bump azure default api version
Allows 'tool_choice' to be passed to azure
This commit is contained in:
parent
d18dc2648c
commit
3d61a316cb
3 changed files with 4 additions and 2 deletions
|
@ -113,6 +113,8 @@ ssl_verify: bool = True
|
||||||
ssl_certificate: Optional[str] = None
|
ssl_certificate: Optional[str] = None
|
||||||
disable_streaming_logging: bool = False
|
disable_streaming_logging: bool = False
|
||||||
in_memory_llm_clients_cache: dict = {}
|
in_memory_llm_clients_cache: dict = {}
|
||||||
|
### DEFAULT AZURE API VERSION ###
|
||||||
|
AZURE_DEFAULT_API_VERSION = "2024-02-01" # this is updated to the latest
|
||||||
### GUARDRAILS ###
|
### GUARDRAILS ###
|
||||||
llamaguard_model_name: Optional[str] = None
|
llamaguard_model_name: Optional[str] = None
|
||||||
openai_moderations_model_name: Optional[str] = None
|
openai_moderations_model_name: Optional[str] = None
|
||||||
|
|
|
@ -3437,7 +3437,7 @@ class Router:
|
||||||
if azure_ad_token.startswith("oidc/"):
|
if azure_ad_token.startswith("oidc/"):
|
||||||
azure_ad_token = get_azure_ad_token_from_oidc(azure_ad_token)
|
azure_ad_token = get_azure_ad_token_from_oidc(azure_ad_token)
|
||||||
if api_version is None:
|
if api_version is None:
|
||||||
api_version = "2023-07-01-preview"
|
api_version = litellm.AZURE_DEFAULT_API_VERSION
|
||||||
|
|
||||||
if "gateway.ai.cloudflare.com" in api_base:
|
if "gateway.ai.cloudflare.com" in api_base:
|
||||||
if not api_base.endswith("/"):
|
if not api_base.endswith("/"):
|
||||||
|
|
|
@ -3634,7 +3634,7 @@ def get_model_region(
|
||||||
model=_model,
|
model=_model,
|
||||||
api_key=litellm_params.api_key,
|
api_key=litellm_params.api_key,
|
||||||
api_base=litellm_params.api_base,
|
api_base=litellm_params.api_base,
|
||||||
api_version=litellm_params.api_version or "2023-07-01-preview",
|
api_version=litellm_params.api_version or litellm.AZURE_DEFAULT_API_VERSION,
|
||||||
timeout=10,
|
timeout=10,
|
||||||
mode=mode or "chat",
|
mode=mode or "chat",
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue