fix: resolve setuptools packaging, Rag SDK NoneType crash, load balancer fallback logic, and add test suites - #22
Open
ankitnarang-ai wants to merge 1 commit into
Conversation
…cer fallback logic, and add test suites
sonuramashishnpm
left a comment
Member
There was a problem hiding this comment.
We will soon aproove it as we are finalised with our new updates we will approve your changes.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR resolves several critical issues across packaging, the Python SDK, load balancer services, and test coverage.
1. 📦 Packaging & Build System (
pyproject.toml)[tool.setuptools.packages.find]to restrict package discovery strictly tonpmai*.Multiple top-level packages discovered in a flat-layouterrors duringpip install .andpip install -e ...gitignoreto prevent committing.venv/,__pycache__,*.egg-info/, and test artifacts.2. 🐍 Python SDK (
npmai/npmai.py)TypeErrorinRag.send(): Fixes crash whenfiles=Noneor omitted (e.g., for URL/link-based queries).try...finallyblock.files_to_sendpersend()invocation.3. ⚖️ Load Balancer Service (
load_balancer/app.py)llm_routerfallback lookup to resolve both standard model names (e.g.gemma2:2b) and_fallmodel names.444and402) with standard400 Bad Requestand404 Not Found.4. 🔗 API Framework (
NPMRAG-API-Framework/NPMRAG-API-Framework.py)is not "",is "") with value equality (!= "",== "") to eliminate Python warnings.5. 🧪 Testing & Verification
npmai_js/package.json): Configured"test": "node --test tests/*.test.js"script (Passed 49/49 unit tests).tests/test_sdk.py): Added unit test suite coveringOllama,Memory, andRagclasses (Passed 12/12 pytest tests).Verification
pip install -e .built and installed successfully.pytest tests/(12 passed)cd npmai_js && npm test(49 passed)