mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 11:43:54 +00:00
(fix) use azure api_version
This commit is contained in:
parent
2aafbe390b
commit
d67c63b0c3
1 changed files with 7 additions and 0 deletions
|
@ -333,10 +333,17 @@ class AzureChatCompletion(BaseLLM):
|
||||||
azure_client_params["api_key"] = api_key
|
azure_client_params["api_key"] = api_key
|
||||||
elif azure_ad_token is not None:
|
elif azure_ad_token is not None:
|
||||||
azure_client_params["azure_ad_token"] = azure_ad_token
|
azure_client_params["azure_ad_token"] = azure_ad_token
|
||||||
|
|
||||||
|
# setting Azure client
|
||||||
if client is None:
|
if client is None:
|
||||||
azure_client = AsyncAzureOpenAI(**azure_client_params)
|
azure_client = AsyncAzureOpenAI(**azure_client_params)
|
||||||
else:
|
else:
|
||||||
azure_client = client
|
azure_client = client
|
||||||
|
if api_version is not None and isinstance(
|
||||||
|
azure_client._custom_query, dict
|
||||||
|
):
|
||||||
|
# set api_version to version passed by user
|
||||||
|
azure_client._custom_query.setdefault("api-version", api_version)
|
||||||
## LOGGING
|
## LOGGING
|
||||||
logging_obj.pre_call(
|
logging_obj.pre_call(
|
||||||
input=data["messages"],
|
input=data["messages"],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue