Update libs/partners/openai/langchain_openai/chat_models/base.py

This commit is contained in:
Bagatur
2024-09-03 23:35:30 -07:00
committed by GitHub
parent 5199555c0d
commit 78c454c130

View File

@@ -489,7 +489,7 @@ class BaseChatOpenAI(BaseChatModel):
sync_specific = {"http_client": self.http_client}
self.root_client = openai.OpenAI(**client_params, **sync_specific) # type: ignore[arg-type]
self.client = self.root_client.chat.completions
if not (self.async_client or None):
if not self.async_client:
if self.openai_proxy and not self.http_async_client:
try:
import httpx