mirror of
https://github.com/hwchase17/langchain
synced 2024-11-06 03:20:49 +00:00
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"
|
values, "openai_api_key", "OPENAI_API_KEY"
|
||||||
)
|
)
|
||||||
openai_organization = get_from_dict_or_env(
|
openai_organization = get_from_dict_or_env(
|
||||||
values, "openai_organization", "OPENAI_ORGANIZATION", default=None
|
values,
|
||||||
|
"openai_organization",
|
||||||
|
"OPENAI_ORGANIZATION",
|
||||||
|
default="",
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
import openai
|
import openai
|
||||||
|
@ -69,7 +69,10 @@ class AzureChatOpenAI(ChatOpenAI):
|
|||||||
"OPENAI_API_TYPE",
|
"OPENAI_API_TYPE",
|
||||||
)
|
)
|
||||||
openai_organization = get_from_dict_or_env(
|
openai_organization = get_from_dict_or_env(
|
||||||
values, "openai_organization", "OPENAI_ORGANIZATION", default=None
|
values,
|
||||||
|
"openai_organization",
|
||||||
|
"OPENAI_ORGANIZATION",
|
||||||
|
default="",
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
import openai
|
import openai
|
||||||
|
@ -152,7 +152,10 @@ class ChatOpenAI(BaseChatModel):
|
|||||||
values, "openai_api_key", "OPENAI_API_KEY"
|
values, "openai_api_key", "OPENAI_API_KEY"
|
||||||
)
|
)
|
||||||
openai_organization = get_from_dict_or_env(
|
openai_organization = get_from_dict_or_env(
|
||||||
values, "openai_organization", "OPENAI_ORGANIZATION", default=None
|
values,
|
||||||
|
"openai_organization",
|
||||||
|
"OPENAI_ORGANIZATION",
|
||||||
|
default="",
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
import openai
|
import openai
|
||||||
|
@ -160,7 +160,10 @@ class OpenAIEmbeddings(BaseModel, Embeddings):
|
|||||||
values, "openai_api_key", "OPENAI_API_KEY"
|
values, "openai_api_key", "OPENAI_API_KEY"
|
||||||
)
|
)
|
||||||
openai_organization = get_from_dict_or_env(
|
openai_organization = get_from_dict_or_env(
|
||||||
values, "openai_organization", "OPENAI_ORGANIZATION", default=None
|
values,
|
||||||
|
"openai_organization",
|
||||||
|
"OPENAI_ORGANIZATION",
|
||||||
|
default="",
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
import openai
|
import openai
|
||||||
|
@ -205,7 +205,10 @@ class BaseOpenAI(BaseLLM):
|
|||||||
values, "openai_api_key", "OPENAI_API_KEY"
|
values, "openai_api_key", "OPENAI_API_KEY"
|
||||||
)
|
)
|
||||||
openai_organization = get_from_dict_or_env(
|
openai_organization = get_from_dict_or_env(
|
||||||
values, "openai_organization", "OPENAI_ORGANIZATION", default=None
|
values,
|
||||||
|
"openai_organization",
|
||||||
|
"OPENAI_ORGANIZATION",
|
||||||
|
default="",
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
import openai
|
import openai
|
||||||
@ -596,7 +599,7 @@ class OpenAIChat(BaseLLM):
|
|||||||
values, "openai_api_key", "OPENAI_API_KEY"
|
values, "openai_api_key", "OPENAI_API_KEY"
|
||||||
)
|
)
|
||||||
openai_organization = get_from_dict_or_env(
|
openai_organization = get_from_dict_or_env(
|
||||||
values, "openai_organization", "OPENAI_ORGANIZATION", default=None
|
values, "openai_organization", "OPENAI_ORGANIZATION", default=""
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
import openai
|
import openai
|
||||||
|
Loading…
Reference in New Issue
Block a user