You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This adds a VectorStore for Azure DB for PostgreSQL.
Currently, the only additional functionality this provides over the PostgresVectorStore is to easily connect to the database using Entra authentication. In the future, we will add capability to leverage the new DiskANN indexing.
Description
Leverage the ability to pass in a custom AsyncConnection class to psycopg_pool's AsyncConnectionPool. The custom AsyncEntraConnection class will identify if a azure.core.credentials TokenCredential or AsyncTokenCredential has been passed as a 'credential' connection argument, or supply the DefaultAzureCredentials if no user or password has been set. This will be used to set the username and password for the Entra user for each new connection the pool creates.
The AzureDBForPosgresSettings overrides methods from PostgresSettings to provide Entra authentication, allowing the user and password to not be set and generating the connection pool with AsyncEntraConnection
The tutorial was updated to allow the user to choose either AzureDBForPostgres or Postgres as the vector store.
TODO:
Unit tests
Integration tests
Contribution Checklist
The code builds clean without any errors or warnings
@moonbox3 sorry for the late reply, I'm just getting back from parental leave. This is ready for review, but I'm still working on testing. I don't see a good way to unit test this code, as it really only adds the ability to create a custom psycopg connection class that uses Entra auth, which is hard to mock and have substantial tests around. I need to create integration tests, which will be more substantial. This will require a PostgreSQL flex server that uses Entra authentication, along with a service principal available to the integration test runner to utilize during the integration tests. Is a service principal already available in that environment? Would it be possible to get a small Azure DB for PostgreSQL flex server with entra auth enabled and the proper IAM roles assigned in the integration test environment?
memorypythonPull requests for the Python Semantic Kernel
3 participants
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.
Motivation and Context
This adds a VectorStore for Azure DB for PostgreSQL.
Currently, the only additional functionality this provides over the PostgresVectorStore is to easily connect to the database using Entra authentication. In the future, we will add capability to leverage the new DiskANN indexing.
Description
TODO:
Contribution Checklist