forked from Archives/langchain
Harrison/allow org none (#2527)
This commit is contained in:
parent
aecd1c8ee3
commit
704b0feb38
@ -39,7 +39,10 @@ class OpenAIModerationChain(Chain):
|
||||
values, "openai_api_key", "OPENAI_API_KEY"
|
||||
)
|
||||
openai_organization = get_from_dict_or_env(
|
||||
values, "openai_organization", "OPENAI_ORGANIZATION", default=None
|
||||
values,
|
||||
"openai_organization",
|
||||
"OPENAI_ORGANIZATION",
|
||||
default="",
|
||||
)
|
||||
try:
|
||||
import openai
|
||||
|
@ -69,7 +69,10 @@ class AzureChatOpenAI(ChatOpenAI):
|
||||
"OPENAI_API_TYPE",
|
||||
)
|
||||
openai_organization = get_from_dict_or_env(
|
||||
values, "openai_organization", "OPENAI_ORGANIZATION", default=None
|
||||
values,
|
||||
"openai_organization",
|
||||
"OPENAI_ORGANIZATION",
|
||||
default="",
|
||||
)
|
||||
try:
|
||||
import openai
|
||||
|
@ -152,7 +152,10 @@ class ChatOpenAI(BaseChatModel):
|
||||
values, "openai_api_key", "OPENAI_API_KEY"
|
||||
)
|
||||
openai_organization = get_from_dict_or_env(
|
||||
values, "openai_organization", "OPENAI_ORGANIZATION", default=None
|
||||
values,
|
||||
"openai_organization",
|
||||
"OPENAI_ORGANIZATION",
|
||||
default="",
|
||||
)
|
||||
try:
|
||||
import openai
|
||||
|
@ -160,7 +160,10 @@ class OpenAIEmbeddings(BaseModel, Embeddings):
|
||||
values, "openai_api_key", "OPENAI_API_KEY"
|
||||
)
|
||||
openai_organization = get_from_dict_or_env(
|
||||
values, "openai_organization", "OPENAI_ORGANIZATION", default=None
|
||||
values,
|
||||
"openai_organization",
|
||||
"OPENAI_ORGANIZATION",
|
||||
default="",
|
||||
)
|
||||
try:
|
||||
import openai
|
||||
|
@ -205,7 +205,10 @@ class BaseOpenAI(BaseLLM):
|
||||
values, "openai_api_key", "OPENAI_API_KEY"
|
||||
)
|
||||
openai_organization = get_from_dict_or_env(
|
||||
values, "openai_organization", "OPENAI_ORGANIZATION", default=None
|
||||
values,
|
||||
"openai_organization",
|
||||
"OPENAI_ORGANIZATION",
|
||||
default="",
|
||||
)
|
||||
try:
|
||||
import openai
|
||||
@ -596,7 +599,7 @@ class OpenAIChat(BaseLLM):
|
||||
values, "openai_api_key", "OPENAI_API_KEY"
|
||||
)
|
||||
openai_organization = get_from_dict_or_env(
|
||||
values, "openai_organization", "OPENAI_ORGANIZATION", default=None
|
||||
values, "openai_organization", "OPENAI_ORGANIZATION", default=""
|
||||
)
|
||||
try:
|
||||
import openai
|
||||
|
Loading…
Reference in New Issue
Block a user