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
Fix potential NoneType error #1247
Conversation
PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here. PR Description updated to latest commit (d4c0678)
|
PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here. PR Review 🔍
|
PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here. PR Code Suggestions ✨
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #1247 +/- ##
=======================================
Coverage 70.22% 70.23%
=======================================
Files 316 316
Lines 18860 18862 +2
=======================================
+ Hits 13245 13248 +3
+ Misses 5615 5614 -1 ☔ View full report in Codecov by Sentry. |
examples/rag_pipeline.py
Outdated
"""RAG pipeline. | ||
|
||
Note: | ||
1. If `use_llm_ranker` is True, then will use LLM Reranker to get better result, but it is not always guaranteed that the output will be parseable for reranking, |
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.
then it will
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.
fixed
User description
Features
Feature Docs
Influence
Result
Other
PR Type
bug_fix
Description
NoneType
errors whenself._index
is None inBM25Retriever
.insert_nodes
andpersist
are only called ifself._index
is not None, enhancing the robustness of the code.Changes walkthrough 📝
bm25_retriever.py
Add null checks for `self._index` in BM25Retriever
metagpt/rag/retrievers/bm25_retriever.py
self._index
is not None before callinginsert_nodes
andpersist
.