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

View File

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