-
Notifications
You must be signed in to change notification settings - Fork 10
chore: add native client to tests #163
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
base: chore/remove_etcd
Are you sure you want to change the base?
Conversation
d4a3527 to
4f69632
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 pull request introduces a new Python SDK client (nilai-py) for the Nilai platform and updates several dependencies to newer versions. The main changes include:
- Adding the
nilai-pyclient package with delegation token management and OpenAI-compatible functionality - Upgrading dependencies:
blindfold(0.1.0rc0 → 0.1.0),isort(6.1.0 → 7.0.0),jiter(0.9.0 → 0.11.0),openai(1.70.0 → 2.4.0),pydantic(2.11.10 → 2.12.2),pydantic-core(2.33.2 → 2.41.4),pytest(8.3.5 → 8.4.2),ruff(0.11.7 → 0.14.1), and others - Adding
coverage(7.11.0) andpytest-cov(7.0.0) for test coverage - Updating
secretvaultsdependency to use a different repository and branch - Refactoring configuration modules to separate concerns
- Removing deprecated logger utilities and updating imports
Reviewed Changes
Copilot reviewed 56 out of 62 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Updated lock file with new dependencies and version upgrades |
| tests/e2e/test_openai.py | Refactored NUC token handling and removed test cases |
| tests/e2e/test_http.py | Updated token handling and removed test cases |
| tests/e2e/nuc.py | Complete rewrite using new nilai-py client |
| tests/e2e/config.py | Updated to use new client and auth token |
| tests/conftest.py | Added pytest configuration for StreamWriter error suppression |
| scripts/credit-init.sql | Updated test credentials with new DID format |
| pyproject.toml | Added nilai-py dependency and updated isort version |
| packages/nilai-common/... | Refactored config modules and removed logger |
| nilai-models/... | Added vLLM template and updated daemon config access |
| nilai-api/... | Updated imports and added metering bypass for docs token |
| docker/... | Updated vLLM template paths |
| clients/nilai-py/... | New SDK client package with comprehensive functionality |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ENVIRONMENT = CONFIG.environment.environment | ||
| # Left for API key for backwards compatibility | ||
| AUTH_TOKEN = CONFIG.auth.auth_token | ||
| AUTH_TOKEN = "SecretTestApiKey" |
Copilot
AI
Oct 29, 2025
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.
Hardcoded test API key should not be committed. Consider using environment variables or a secure configuration management system to store test credentials.
|
|
||
|
|
||
| # Global host settings instance | ||
| SETTINGS: HostSettings = HostSettings( |
Copilot
AI
Oct 29, 2025
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.
The global variable 'SETTINGS' is not used.
|
|
||
|
|
||
| # Global model settings instance | ||
| MODEL_SETTINGS: ModelSettings = ModelSettings( |
Copilot
AI
Oct 29, 2025
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.
The global variable 'MODEL_SETTINGS' is not used.
| ) | ||
|
|
||
| # Global model capabilities instance | ||
| MODEL_CAPABILITIES: ModelCapabilities = ModelCapabilities( |
Copilot
AI
Oct 29, 2025
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.
The global variable 'MODEL_CAPABILITIES' is not used.
|
|
||
| if __name__ == "__main__": | ||
| try: | ||
| version = main() |
Copilot
AI
Oct 29, 2025
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.
The global variable 'version' is not used.
| version = main() | |
| main() |
| delegation_token_response.delegation_token | ||
| ) | ||
|
|
||
| def _get_invocation_token(self) -> str: |
Copilot
AI
Oct 29, 2025
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.
Mixing implicit and explicit returns may indicate an error, as implicit returns always return None.
| print( | ||
| f"Using NilDB Configuration:\n Nilchain URL: {DefaultNilDBConfig.nilchain_url}\n Nilauth URL: {DefaultNilDBConfig.nilauth_url}\n Nodes: {DefaultNilDBConfig.nodes}\n Collection ID: {DefaultNilDBConfig.collection}" | ||
| ) |
Copilot
AI
Oct 29, 2025
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.
Print statement may execute during import.
| print( | |
| f"Using NilDB Configuration:\n Nilchain URL: {DefaultNilDBConfig.nilchain_url}\n Nilauth URL: {DefaultNilDBConfig.nilauth_url}\n Nodes: {DefaultNilDBConfig.nodes}\n Collection ID: {DefaultNilDBConfig.collection}" | |
| ) | |
| if __name__ == "__main__": | |
| print( | |
| f"Using NilDB Configuration:\n Nilchain URL: {DefaultNilDBConfig.nilchain_url}\n Nilauth URL: {DefaultNilDBConfig.nilauth_url}\n Nodes: {DefaultNilDBConfig.nodes}\n Collection ID: {DefaultNilDBConfig.collection}" | |
| ) |
No description provided.