Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello! This PR is by no means production ready, I mainly wanted to alert you to a couple issues I had with Azure and my (super quick) fixes.
Changes made:
upload.py
file was always creating a PGVector store withOpenAIEmbeddings()
. In my use case, I am only using Azure. So without an openai key set, the app would not start up. I created a simple function that sees if there is an openai key env variable set and returns a PGVector store withOpenAIEmbeddings
. If that was not found, it tries the same with Azure. If that was not found, it raises an exception.llms.py
theAzureChatOpenAI
was created with theopenai_api_base
variable set. As ofopenai>=1.0.0
this has been changed toazure_endpoint
.llms.py
during the startup of the app, it would crash due to me not having an OpenAI api key set. I created a simple try / catch block to try and fall back to Azure in that instance.These changes work for me but as I do not have an openai api key I can not test for conflicts caused by these changes.