nemoguardrails.library.jailbreak_detection.rail_config
nemoguardrails.library.jailbreak_detection.rail_config
Module Contents
Classes
Functions
Data
API
Bases: RailConfigBaseModel
Configuration data for jailbreak detection.
api_key
api_key_env_var
embedding
length_per_perplexity_threshold
nim_base_url
nim_port
nim_server_endpoint
nim_url
prefix_suffix_perplexity_threshold
server_endpoint
Helper to return an API key (if it exists) from a Jailbreak configuration. This can come from (in descending order of priority):
- The
api_keyfield, a Pydantic SecretStr from which we extract the full string. - The
api_key_env_varfield, a string stored in this environment variable.
If neither is found, None is returned.
Migrate deprecated nim_url/nim_port fields to nim_base_url format.
Validate URL formats for endpoints.