EncodedPrompt#

class scikitplot.cleanprompt.EncodedPrompt(text, handle, result, report=<factory>)[source]#

The result of encode: a safe text and the handle to undo it.

Parameters:
textstr

Safe to send.

handleHandle

Not safe to send.

resultRedactionResult

The full result, for callers that want the detail.

reportdict

What happened, and what was not looking; see describe_outcome.

Parameters:

Notes

User notes. Unpacks as a pair, so the common case reads well:

safe, handle = encode(text)

Check report["level"]: "alert" means nothing was redacted and part of the detection surface is switched off, which is the one case where an empty result should not be read as “there was nothing to find”.

property count: int#

How many distinct values were replaced.

Type:

int

handle: Handle[source]#
property level: str#

"ok", "warning" or "alert".

Type:

str

report: dict[str, Any][source]#
result: RedactionResult[source]#
text: str[source]#