You can check and replace Personal Identifiable Information (PII) from the /PII
endpoint or PII
class in the Python Client. This endpoint/Class takes three parameters:
prompt
- The prompt that you want to check for PII.replace
- A boolean for replacing the PII if any is found.replace_method
- The method you would like to use to replace any found PII. The methods arerandom
,mask
,category
, andfake
.
The output will include the replaced PII if any is present, or will tell you if any PII is in the prompt if replace
is not chosen.
Check and Replace PII
To check and replace PII, you can use the following code examples. Depending on your preference or requirements, select the appropriate method for your application.
This approach provides a straightforward way for readers to choose and apply the code example that best suits their needs for checking and replacing PII using either Python or cURL.