mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 19:24:27 +00:00
fix linting error
This commit is contained in:
parent
e3752cd32a
commit
40736c3263
2 changed files with 7 additions and 5 deletions
|
@ -43,6 +43,7 @@ class AzureAssistantsAPI(BaseAzureLLM):
|
||||||
api_base=api_base,
|
api_base=api_base,
|
||||||
model_name="",
|
model_name="",
|
||||||
api_version=api_version,
|
api_version=api_version,
|
||||||
|
is_async=False,
|
||||||
)
|
)
|
||||||
azure_openai_client = AzureOpenAI(**azure_client_params) # type: ignore
|
azure_openai_client = AzureOpenAI(**azure_client_params) # type: ignore
|
||||||
else:
|
else:
|
||||||
|
@ -68,6 +69,7 @@ class AzureAssistantsAPI(BaseAzureLLM):
|
||||||
api_base=api_base,
|
api_base=api_base,
|
||||||
model_name="",
|
model_name="",
|
||||||
api_version=api_version,
|
api_version=api_version,
|
||||||
|
is_async=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
azure_openai_client = AsyncAzureOpenAI(**azure_client_params)
|
azure_openai_client = AsyncAzureOpenAI(**azure_client_params)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
from typing import Callable, Optional, Union
|
from typing import Any, Callable, Dict, Optional, Union
|
||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
from openai import AsyncAzureOpenAI, AzureOpenAI
|
from openai import AsyncAzureOpenAI, AzureOpenAI
|
||||||
|
@ -385,7 +385,7 @@ class BaseAzureLLM(BaseOpenAILLM):
|
||||||
api_base += "/"
|
api_base += "/"
|
||||||
api_base += f"{model}"
|
api_base += f"{model}"
|
||||||
|
|
||||||
azure_client_params = {
|
azure_client_params: Dict[str, Any] = {
|
||||||
"api_version": api_version,
|
"api_version": api_version,
|
||||||
"base_url": f"{api_base}",
|
"base_url": f"{api_base}",
|
||||||
"http_client": litellm.client_session,
|
"http_client": litellm.client_session,
|
||||||
|
@ -399,11 +399,11 @@ class BaseAzureLLM(BaseOpenAILLM):
|
||||||
azure_ad_token = get_azure_ad_token_from_oidc(azure_ad_token)
|
azure_ad_token = get_azure_ad_token_from_oidc(azure_ad_token)
|
||||||
|
|
||||||
azure_client_params["azure_ad_token"] = azure_ad_token
|
azure_client_params["azure_ad_token"] = azure_ad_token
|
||||||
elif azure_ad_token_provider is not None:
|
if azure_ad_token_provider is not None:
|
||||||
azure_client_params["azure_ad_token_provider"] = azure_ad_token_provider
|
azure_client_params["azure_ad_token_provider"] = azure_ad_token_provider
|
||||||
|
|
||||||
if acompletion is True:
|
if acompletion is True:
|
||||||
client = AsyncAzureOpenAI(**azure_client_params)
|
client = AsyncAzureOpenAI(**azure_client_params) # type: ignore
|
||||||
else:
|
else:
|
||||||
client = AzureOpenAI(**azure_client_params)
|
client = AzureOpenAI(**azure_client_params) # type: ignore
|
||||||
return client
|
return client
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue