chore: add native client to tests#163
Conversation
d4a3527 to
4f69632
Compare
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
The global variable 'SETTINGS' is not used.
|
|
||
|
|
||
| # Global model settings instance | ||
| MODEL_SETTINGS: ModelSettings = ModelSettings( |
There was a problem hiding this comment.
The global variable 'MODEL_SETTINGS' is not used.
| ) | ||
|
|
||
| # Global model capabilities instance | ||
| MODEL_CAPABILITIES: ModelCapabilities = ModelCapabilities( |
There was a problem hiding this comment.
The global variable 'MODEL_CAPABILITIES' is not used.
|
|
||
| if __name__ == "__main__": | ||
| try: | ||
| version = main() |
There was a problem hiding this comment.
The global variable 'version' is not used.
| version = main() | |
| main() |
| delegation_token_response.delegation_token | ||
| ) | ||
|
|
||
| def _get_invocation_token(self) -> str: |
There was a problem hiding this comment.
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}" | ||
| ) |
There was a problem hiding this comment.
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}" | |
| ) |
700c26a to
f122282
Compare
fb345e6 to
a95ff6e
Compare
* feat: added improved database structure and logging * feat: updated nilauth-credit image hash * feat: unit test corrections * fix: pytests unit and e2e errors * fix: improved and fixed gpt oss CI docker compose file * fix: e2e fixes for responses endpoints * fix: nildb commands
No description provided.