This commit is contained in:
Chester Curme 2025-02-21 21:23:07 -05:00
parent c23d7f1c2a
commit e19fed1fcc
2 changed files with 12 additions and 4 deletions

View File

@ -660,7 +660,7 @@ class AzureChatOpenAI(BaseChatOpenAI):
return self
@property
def root_client(self) -> openai.AzureOpenAI:
def root_client(self) -> Any:
if self._root_client is None:
sync_specific = {"http_client": self.http_client}
self._root_client = openai.AzureOpenAI(
@ -669,8 +669,12 @@ class AzureChatOpenAI(BaseChatOpenAI):
)
return self._root_client
@root_client.setter
def root_client(self, value: openai.AzureOpenAI) -> None:
self._root_client = value
@property
def root_async_client(self) -> openai.AsyncAzureOpenAI:
def root_async_client(self) -> Any:
if self._root_async_client is None:
async_specific = {"http_client": self.http_async_client}
self._root_async_client = openai.AsyncAzureOpenAI(
@ -679,6 +683,10 @@ class AzureChatOpenAI(BaseChatOpenAI):
)
return self._root_async_client
@root_async_client.setter
def root_async_client(self, value: openai.AsyncAzureOpenAI) -> None:
self._root_async_client = value
@property
def _identifying_params(self) -> Dict[str, Any]:
"""Get the identifying parameters."""

View File

@ -634,7 +634,7 @@ class BaseChatOpenAI(BaseChatModel):
return self._http_async_client
@property
def root_client(self) -> openai.OpenAI:
def root_client(self) -> Any:
if self._root_client is None:
sync_specific = {"http_client": self.http_client}
self._root_client = openai.OpenAI(
@ -648,7 +648,7 @@ class BaseChatOpenAI(BaseChatModel):
self._root_client = value
@property
def root_async_client(self) -> openai.AsyncOpenAI:
def root_async_client(self) -> Any:
if self._root_async_client is None:
async_specific = {"http_client": self.http_async_client}
self._root_async_client = openai.AsyncOpenAI(