nemoguardrails.library.jailbreak_detection.request

View as Markdown

Module Contents

Functions

NameDescription
jailbreak_detection_heuristics_request-
jailbreak_detection_model_request-
jailbreak_nim_request-
join_nim_urlJoin NIM base URL with classification path, handling trailing/leading slashes.

Data

log

API

nemoguardrails.library.jailbreak_detection.request.jailbreak_detection_heuristics_request(
prompt: str,
api_url: str = 'http://localhost:1337/heur...,
lp_threshold: typing.Optional[float] = None,
ps_ppl_threshold: typing.Optional[float] = None
)
async
nemoguardrails.library.jailbreak_detection.request.jailbreak_detection_model_request(
prompt: str,
api_url: str = 'http://localhost:1337/model'
)
async
nemoguardrails.library.jailbreak_detection.request.jailbreak_nim_request(
prompt: str,
nim_url: str,
nim_auth_token: typing.Optional[str],
nim_classification_path: str
)
async
nemoguardrails.library.jailbreak_detection.request.join_nim_url(
base_url: str,
classification_path: str
) -> str

Join NIM base URL with classification path, handling trailing/leading slashes.

Parameters:

base_url
str

The base NIM URL (with or without trailing slash)

classification_path
str

The classification endpoint path (with or without leading slash)

Returns: str

Properly joined URL

nemoguardrails.library.jailbreak_detection.request.log = logging.getLogger(__name__)