mirror of
https://github.com/hwchase17/langchain
synced 2024-11-10 01:10:59 +00:00
community: Fix azure_openai.py (#24572)
In some lines its trying to read a key that do not exists yet. In this cases I changed the direct access to dict.get() method - [ x] **Lint and test**: Run `make format`, `make lint` and `make test` from the root of the package(s) you've modified. See contribution guidelines for more: https://python.langchain.com/docs/contributing/
This commit is contained in:
parent
bff6ca78a2
commit
325068bb53
@ -65,10 +65,10 @@ class AzureOpenAIEmbeddings(OpenAIEmbeddings):
|
||||
or os.getenv("AZURE_OPENAI_API_KEY")
|
||||
or os.getenv("OPENAI_API_KEY")
|
||||
)
|
||||
values["openai_api_base"] = values["openai_api_base"] or os.getenv(
|
||||
values["openai_api_base"] = values.get("openai_api_base") or os.getenv(
|
||||
"OPENAI_API_BASE"
|
||||
)
|
||||
values["openai_api_version"] = values["openai_api_version"] or os.getenv(
|
||||
values["openai_api_version"] = values.get("openai_api_version") or os.getenv(
|
||||
"OPENAI_API_VERSION", default="2023-05-15"
|
||||
)
|
||||
values["openai_api_type"] = get_from_dict_or_env(
|
||||
|
Loading…
Reference in New Issue
Block a user