mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
feat(azure.py): fix azure client init
This commit is contained in:
parent
c5a80cc690
commit
23ca233f42
2 changed files with 11 additions and 97 deletions
|
@ -5353,36 +5353,12 @@ class Router:
|
|||
client = self.cache.get_cache(
|
||||
key=cache_key, local_only=True, parent_otel_span=parent_otel_span
|
||||
)
|
||||
if client is None:
|
||||
"""
|
||||
Re-initialize the client
|
||||
"""
|
||||
InitalizeOpenAISDKClient.set_client(
|
||||
litellm_router_instance=self, model=deployment
|
||||
)
|
||||
client = self.cache.get_cache(
|
||||
key=cache_key,
|
||||
local_only=True,
|
||||
parent_otel_span=parent_otel_span,
|
||||
)
|
||||
return client
|
||||
else:
|
||||
cache_key = f"{model_id}_async_client"
|
||||
client = self.cache.get_cache(
|
||||
key=cache_key, local_only=True, parent_otel_span=parent_otel_span
|
||||
)
|
||||
# if client is None:
|
||||
# """
|
||||
# Re-initialize the client
|
||||
# """
|
||||
# InitalizeOpenAISDKClient.set_client(
|
||||
# litellm_router_instance=self, model=deployment
|
||||
# )
|
||||
# client = self.cache.get_cache(
|
||||
# key=cache_key,
|
||||
# local_only=True,
|
||||
# parent_otel_span=parent_otel_span,
|
||||
# )
|
||||
return client
|
||||
else:
|
||||
if kwargs.get("stream") is True:
|
||||
|
@ -5390,32 +5366,12 @@ class Router:
|
|||
client = self.cache.get_cache(
|
||||
key=cache_key, parent_otel_span=parent_otel_span
|
||||
)
|
||||
if client is None:
|
||||
"""
|
||||
Re-initialize the client
|
||||
"""
|
||||
InitalizeOpenAISDKClient.set_client(
|
||||
litellm_router_instance=self, model=deployment
|
||||
)
|
||||
client = self.cache.get_cache(
|
||||
key=cache_key, parent_otel_span=parent_otel_span
|
||||
)
|
||||
return client
|
||||
else:
|
||||
cache_key = f"{model_id}_client"
|
||||
client = self.cache.get_cache(
|
||||
key=cache_key, parent_otel_span=parent_otel_span
|
||||
)
|
||||
if client is None:
|
||||
"""
|
||||
Re-initialize the client
|
||||
"""
|
||||
InitalizeOpenAISDKClient.set_client(
|
||||
litellm_router_instance=self, model=deployment
|
||||
)
|
||||
client = self.cache.get_cache(
|
||||
key=cache_key, parent_otel_span=parent_otel_span
|
||||
)
|
||||
return client
|
||||
|
||||
def _pre_call_checks( # noqa: PLR0915
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue