You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support NIM API key for NemoGuard JailbreakDetect (#1214)
* Update jailbreak detection compatibility for NIM to allow providing an API key.
* Allow configurable classification path.
* Clean up unused dependencies. Update `JailbreakDetectionConfig` object to use base_url and endpoints. Refactor checks to align with base_uri and api_key_env_var approaches. Add additional error handling and logging. Fix tests to reflect changes.
Signed-off-by: Erick Galinkin <egalinkin@nvidia.com>
* apply black
Signed-off-by: Erick Galinkin <egalinkin@nvidia.com>
* style: apply pre-commits
* Support deprecated `nim_url` and `nim_port` fields.
Signed-off-by: Erick Galinkin <egalinkin@nvidia.com>
* Push test update for deprecated parameters
Signed-off-by: Erick Galinkin <egalinkin@nvidia.com>
* fix: improve error handling in check_jailbreak function
- Fix TypeError when classifier is None by adding defensive programming
- Replace silent failure with clear RuntimeError and descriptive message
- Simplify calling code by removing redundant null checks from actions.py and server.py
- Update tests to match new function signature and behavior
- Add test coverage for new RuntimeError path
This resolves the critical bug where check_jailbreak(prompt) would crash with
"TypeError: 'NoneType' object is not callable" when EMBEDDING_CLASSIFIER_PATH
is not set. Now it raises a clear RuntimeError with guidance on how to fix it.
* fix
fix
* fix(request): make nim_auth_token optional in request
* test: add more tests
* fix model path mocking and assertion for windows
---------
Signed-off-by: Erick Galinkin <egalinkin@nvidia.com>
Co-authored-by: Pouyanpi <13303554+Pouyanpi@users.noreply.github.com>
0 commit comments