forked from Archives/langchain
OpenAI lint (#5273)
Causing lint issues if you have openai installed, annoying for local dev
This commit is contained in:
parent
7652d2abb0
commit
f01dfe858d
@ -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. "
|
||||||
|
@ -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:
|
||||||
|
@ -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(
|
||||||
|
@ -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. "
|
||||||
|
Loading…
Reference in New Issue
Block a user