OpenAI lint (#5273)

Causing lint issues if you have openai installed, annoying for local dev
This commit is contained in:
Davis Chase 2023-05-25 16:20:06 -07:00 committed by GitHub
parent 7652d2abb0
commit f01dfe858d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 5 deletions

View File

@ -94,7 +94,7 @@ class AzureChatOpenAI(ChatOpenAI):
if openai_organization: if openai_organization:
openai.organization = openai_organization openai.organization = openai_organization
if openai_proxy: 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: except ImportError:
raise ImportError( raise ImportError(
"Could not import openai python package. " "Could not import openai python package. "

View File

@ -231,7 +231,7 @@ class ChatOpenAI(BaseChatModel):
if openai_api_base: if openai_api_base:
openai.api_base = openai_api_base openai.api_base = openai_api_base
if openai_proxy: 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: try:
values["client"] = openai.ChatCompletion values["client"] = openai.ChatCompletion
except AttributeError: except AttributeError:

View File

@ -186,7 +186,7 @@ class OpenAIEmbeddings(BaseModel, Embeddings):
if openai_api_type: if openai_api_type:
openai.api_type = openai_api_type openai.api_type = openai_api_type
if openai_proxy: 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 values["client"] = openai.Embedding
except ImportError: except ImportError:
raise ImportError( raise ImportError(

View File

@ -241,7 +241,7 @@ class BaseOpenAI(BaseLLM):
if openai_organization: if openai_organization:
openai.organization = openai_organization openai.organization = openai_organization
if openai_proxy: 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 values["client"] = openai.Completion
except ImportError: except ImportError:
raise ImportError( raise ImportError(
@ -699,7 +699,7 @@ class OpenAIChat(BaseLLM):
if openai_organization: if openai_organization:
openai.organization = openai_organization openai.organization = openai_organization
if openai_proxy: 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: except ImportError:
raise ImportError( raise ImportError(
"Could not import openai python package. " "Could not import openai python package. "