-
Notifications
You must be signed in to change notification settings - Fork 10
feat: nilDB prompt storage in nilAI #147
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
Conversation
92b3ef5 to
65998b3
Compare
4c29bff to
f0746bf
Compare
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.
Pull Request Overview
This PR implements nilDB prompt storage integration in nilAI, allowing NUC tokens to include prompt documents that will be automatically injected into chat completions. The main changes include adding nilDB document handling to the authentication system, creating a new delegation endpoint for prompt store access, and modifying chat completion logic to support prompt injection from nilDB documents.
- nilDB Integration: Added PromptDocument extraction from NUC tokens and prompt injection into chat completions
- NilDB Delegation Endpoint: Created REST endpoint for getting delegation tokens for prompt storage
- Configuration Updates: Modified default parameter handling and dependency versions
Reviewed Changes
Copilot reviewed 29 out of 32 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/nuc_helpers/test_usage.py | Refactored to use shared dummy classes from init.py |
| tests/unit/nuc_helpers/test_nildb_document.py | Added comprehensive tests for PromptDocument extraction from NUC tokens |
| tests/unit/nuc_helpers/init.py | Created shared test utilities with dummy NUC token classes |
| tests/unit/nilai_api/routers/test_private.py | Updated mock configuration for authentication tests |
| tests/unit/nilai_api/routers/test_nildb_endpoints.py | Added tests for new nilDB delegation and chat completion endpoints |
| tests/unit/nilai_api/handlers/test_nildb_handler.py | Added tests for nilDB handler functions |
| tests/unit/nilai_api/conftest.py | Added sentence transformer mocking for testing |
| tests/unit/nilai_api/auth/test_strategies.py | Added tests for authentication strategies with prompt document support |
| tests/unit/nilai_api/auth/test_nuc.py | Added tests for NUC token prompt document extraction |
| tests/e2e/test_http.py | Added end-to-end tests for nilDB functionality |
| tests/e2e/nuc.py | Extended NUC token generation with document ID support |
| scripts/docker-composer.py | Added volume preservation option for development environments |
| packages/nilai-common/src/nilai_common/api_model.py | Changed ChatRequest defaults to None for better flexibility |
| nilai-auth/nuc-helpers/src/nuc_helpers/usage.py | Fixed return type documentation |
| nilai-auth/nuc-helpers/src/nuc_helpers/nildb_document.py | Added PromptDocument class for extracting document metadata from tokens |
| nilai-auth/nuc-helpers/src/nuc_helpers/helpers.py | Extended delegation token creation with document metadata support |
| nilai-auth/nuc-helpers/pyproject.toml | Updated nuc dependency version constraint |
| nilai-api/src/nilai_api/routers/private.py | Added nilDB delegation endpoint and prompt injection logic |
| nilai-api/src/nilai_api/handlers/nildb/handler.py | Implemented core nilDB client operations |
| nilai-api/src/nilai_api/handlers/nildb/config.py | Added configuration handling for nilDB connections |
| nilai-api/src/nilai_api/handlers/nildb/api_model.py | Added API models for delegation requests/responses |
| nilai-api/src/nilai_api/db/users.py | Added subscription owner property to UserData |
| nilai-api/src/nilai_api/auth/strategies.py | Updated auth strategies to include prompt document extraction |
| nilai-api/src/nilai_api/auth/nuc.py | Added prompt document extraction function |
| nilai-api/src/nilai_api/auth/common.py | Extended AuthenticationInfo with prompt document field |
| nilai-api/pyproject.toml | Added secretvaults dependency for nilDB integration |
| conftest.py | Added global pytest configuration |
| .github/workflows/cicd.yml | Added environment variable setup for nilDB configuration |
| .env.ci | Added nilDB configuration variables |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This PR implements nilDB prompt storage integration in nilAI, allowing NUC tokens to include prompt documents that will be automatically injected into chat completions. The main changes include adding nilDB document handling to the authentication system, creating a new delegation endpoint for prompt store access, and modifying chat completion logic to support prompt injection from nilDB documents.