-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
langchain_aws:documentdb_vectorstore with async capabilities #30
base: main
Are you sure you want to change the base?
Conversation
@3coins Would you kindly review? |
@Alonoparag |
if TYPE_CHECKING: | ||
from langchain_core.vectorstores import ( | ||
VectorStore, # noqa: F401 | ||
) | ||
|
||
from langchain_aws.vectorstores.documentdb import ( | ||
DocumentDBVectorSearch, # noqa: F401 | ||
) | ||
__all__ = [ | ||
"DocumentDBVectorSearch", | ||
] | ||
|
||
_module_lookup = { | ||
"DocumentDBVectorSearch": "langchain_community.vectorstores.documentdb", | ||
} | ||
|
||
|
||
def __getattr__(name: str) -> Any: | ||
if name in _module_lookup: | ||
module = importlib.import_module(_module_lookup[name]) | ||
return getattr(module, name) | ||
raise AttributeError(f"module {__name__} has no attribute {name}") | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the need for this setup?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@3coins I copied the setup of langchain_community/vectorstores/__init__.py
, but AFAIK it's redundant.
CI errors should be resolved with latest commits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, we can just use a regular import for the DocumentDBVectorSearch
, and remove the rest of the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Adding missing libraries and conftest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Alonoparag
Thanks for fixing the CI. There seems to be some references to langchain_community
, please remove and update them to refer to the current package. Also, make sure you are able to run and execute the integration tests successfully.
if TYPE_CHECKING: | ||
from langchain_core.vectorstores import ( | ||
VectorStore, # noqa: F401 | ||
) | ||
|
||
from langchain_aws.vectorstores.documentdb import ( | ||
DocumentDBVectorSearch, # noqa: F401 | ||
) | ||
__all__ = [ | ||
"DocumentDBVectorSearch", | ||
] | ||
|
||
_module_lookup = { | ||
"DocumentDBVectorSearch": "langchain_community.vectorstores.documentdb", | ||
} | ||
|
||
|
||
def __getattr__(name: str) -> Any: | ||
if name in _module_lookup: | ||
module = importlib.import_module(_module_lookup[name]) | ||
return getattr(module, name) | ||
raise AttributeError(f"module {__name__} has no attribute {name}") | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, we can just use a regular import for the DocumentDBVectorSearch
, and remove the rest of the code.
Example: | ||
. code-block:: python | ||
|
||
from langchain_community.vectorstores import DocumentDBVectorSearch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update this to refer to langchain_aws
. There are other similar references in the PR, please correct those.
cd libs/community | ||
make test TEST_FILE=tests/integration_tests/vectorstores/test_documentdb.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs an update to refer to langchain-aws
. Were you able to run these tests and confirm these run successfully after copying the files here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
@efriis |
They definitely would! You can add any secrets to the Actions secrets in this repo, and you have to make sure they get passed through during the integration testing step in _release.yml Happy to help if you need! |
@3coins Seems like the integration tests runner did not install motor. |
@3coins the missing packages (motor, pymongo) are marked as extra. Can we change the CI file to install extras when the test is compiled? |
@Alonoparag |
any update on this pr ? |
@mohittalele Still waiting for approval |
@3coins Any updates? The CI currently fails due to unrelated code (Bedrock). I've been using the added vectorstore myself in production since April, and I see no reason why it shouldn't be added to langchain-aws |
Description
Adding documentdb_vectorestore from langchain_community, and adding async capabilities to it.
Dependencies
Twitter handle
@Sunshineallon