refactor(utils_pkg): keep local copy of bm25 retriever to drop langchain-community - #103
Conversation
sanjayankur31
left a comment
There was a problem hiding this comment.
A few minor tweaks. Please note if any AI was used in the preparation of this PR.
If you could also improve the commit message to explain why we've done this, that'll be good---it'll be documented for future contributors (you can just take the note removed from setup.cfg).
…ementation langchain-community is being sunset/deprecated. To avoid depending on a deprecated package, this commit ports the BM25Retriever wrapper directly into utils_pkg/klea_utils/stores/langchain_bm25.py. Fixes NeuroML#103.
2b52c06 to
416fb17
Compare
Yes, I used an AI assistant (Gemini) to help writing docstrings/headers and drafting the PR description. |
|
I've updated the PR to address the review feedback. Just to let you know regarding the failing Ruff CI check: it's triggering on pre-existing issues in untouched modules. The files modified in this PR pass all local Ruff checks cleanly. |
sanjayankur31
left a comment
There was a problem hiding this comment.
Looks great, thanks. merging.
@allcontributors please add @Coderdhanush2003 for code
|
Thanks @sanjayankur31! I recently updated my GitHub username. @allcontributors please add @dhanushshankar-hq for code |
|
I've put up a pull request to add @dhanushshankar-hq! 🎉 |
Related Issue
Fixes #102
Description
This PR addresses the
DeprecationWarningcaused bylangchain-communitybeing sunset. As discussed in the issue, it drops the external dependency by creating a local, standalone copy of the BM25 wrapper module.Changes Made
utils_pkg/klea_utils/stores/langchain_bm25.py: Created a local copy of theBM25Retrieverlogic fromlangchain-community.utils_pkg/klea_utils/stores/retrieval/bm25.py:langchain_communityimport with the new local module.utils_pkg/setup.cfg: Removedlangchain-communityfrom the package dependencies.