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

This commit is contained in:
Bagatur
2024-09-03 23:35:56 -07:00
committed by GitHub
parent c0448f27ba
commit 76572f963b

View File

@@ -334,7 +334,7 @@ class OpenAIEmbeddings(BaseModel, Embeddings):
self.http_client = httpx.Client(proxy=self.openai_proxy)
sync_specific = {"http_client": self.http_client}
self.client = openai.OpenAI(**client_params, **sync_specific).embeddings # type: ignore[arg-type]
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