From f01dfe858d77a6b61bf6e471ea6583a70d52513f Mon Sep 17 00:00:00 2001 From: Davis Chase <130488702+dev2049@users.noreply.github.com> Date: Thu, 25 May 2023 16:20:06 -0700 Subject: [PATCH] OpenAI lint (#5273) Causing lint issues if you have openai installed, annoying for local dev --- langchain/chat_models/azure_openai.py | 2 +- langchain/chat_models/openai.py | 2 +- langchain/embeddings/openai.py | 2 +- langchain/llms/openai.py | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/langchain/chat_models/azure_openai.py b/langchain/chat_models/azure_openai.py index 6a76d8e2..10206049 100644 --- a/langchain/chat_models/azure_openai.py +++ b/langchain/chat_models/azure_openai.py @@ -94,7 +94,7 @@ class AzureChatOpenAI(ChatOpenAI): if openai_organization: openai.organization = openai_organization if openai_proxy: - openai.proxy = {"http": openai_proxy, "https": openai_proxy} + openai.proxy = {"http": openai_proxy, "https": openai_proxy} # type: ignore[assignment] # noqa: E501 except ImportError: raise ImportError( "Could not import openai python package. " diff --git a/langchain/chat_models/openai.py b/langchain/chat_models/openai.py index d5cf669f..b30e4820 100644 --- a/langchain/chat_models/openai.py +++ b/langchain/chat_models/openai.py @@ -231,7 +231,7 @@ class ChatOpenAI(BaseChatModel): if openai_api_base: openai.api_base = openai_api_base if openai_proxy: - openai.proxy = {"http": openai_proxy, "https": openai_proxy} + openai.proxy = {"http": openai_proxy, "https": openai_proxy} # type: ignore[assignment] # noqa: E501 try: values["client"] = openai.ChatCompletion except AttributeError: diff --git a/langchain/embeddings/openai.py b/langchain/embeddings/openai.py index bed27101..1fa9916d 100644 --- a/langchain/embeddings/openai.py +++ b/langchain/embeddings/openai.py @@ -186,7 +186,7 @@ class OpenAIEmbeddings(BaseModel, Embeddings): if openai_api_type: openai.api_type = openai_api_type if openai_proxy: - openai.proxy = {"http": openai_proxy, "https": openai_proxy} + openai.proxy = {"http": openai_proxy, "https": openai_proxy} # type: ignore[assignment] # noqa: E501 values["client"] = openai.Embedding except ImportError: raise ImportError( diff --git a/langchain/llms/openai.py b/langchain/llms/openai.py index e36a9b83..bcb3ac9f 100644 --- a/langchain/llms/openai.py +++ b/langchain/llms/openai.py @@ -241,7 +241,7 @@ class BaseOpenAI(BaseLLM): if openai_organization: openai.organization = openai_organization if openai_proxy: - openai.proxy = {"http": openai_proxy, "https": openai_proxy} + openai.proxy = {"http": openai_proxy, "https": openai_proxy} # type: ignore[assignment] # noqa: E501 values["client"] = openai.Completion except ImportError: raise ImportError( @@ -699,7 +699,7 @@ class OpenAIChat(BaseLLM): if openai_organization: openai.organization = openai_organization if openai_proxy: - openai.proxy = {"http": openai_proxy, "https": openai_proxy} + openai.proxy = {"http": openai_proxy, "https": openai_proxy} # type: ignore[assignment] # noqa: E501 except ImportError: raise ImportError( "Could not import openai python package. "