PII
Get PII Capabilities
Reports the entity catalog, supported regions, and default thresholds the PII detection service currently exposes, including per-entity default thresholds.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.pii.capabilities()
# Handle response
print(res)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.pii.capabilities();
console.log(result);
}
run();
Show Response
Show Response
{
"languages": List[str], # optional
"base_entities": List[str], # optional
"all_entities": List[str], # optional
"regions": List[str], # optional
"region_entities": { # optional
"entities": List[str], # optional
},
"entity_thresholds": Dict[str, float], # optional
"default_threshold": Optional[float],
"max_text_chars": Optional[int],
}
{
languages?: string[];
baseEntities?: string[];
allEntities?: string[];
regions?: string[];
regionEntities?: {
entities?: string[];
};
entityThresholds?: Record<string, number>;
defaultThreshold?: number;
maxTextChars?: number;
}
Detect PII
Reports whether the supplied text contains personally identifiable information, optionally with a per-type entity breakdown.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.pii.detect()
# Handle response
print(res)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.pii.detect({});
console.log(result);
}
run();
Show Parameters
Show Parameters
{
"text": Optional[str],
"language": Optional[str],
"threshold": Optional[float],
"include_entities": Optional[bool],
"regions": List[str], # optional
"entities": List[str], # optional
"entity_thresholds": Dict[str, float], # optional
}
{
text?: string;
language?: string;
threshold?: number;
includeEntities?: boolean;
regions?: string[];
entities?: string[];
entityThresholds?: Record<string, number>;
}
Show Response
Show Response
{
"has_pii": Optional[bool],
"entities": Dict[str, int], # optional
}
{
hasPii?: boolean;
entities?: Record<string, number>;
}
Redact PII
Replaces detected PII with placeholders and returns the reverse mapping needed to restore the original text.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.pii.redact()
# Handle response
print(res)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.pii.redact({});
console.log(result);
}
run();
Show Parameters
Show Parameters
{
"text": Optional[str],
"language": Optional[str],
"threshold": Optional[float],
"regions": List[str], # optional
"entities": List[str], # optional
"entity_thresholds": Dict[str, float], # optional
}
{
text?: string;
language?: string;
threshold?: number;
regions?: string[];
entities?: string[];
entityThresholds?: Record<string, number>;
}
Show Response
Show Response
{
"redacted_text": Optional[str],
"mappings": Dict[str, str], # optional
}
{
redactedText?: string;
mappings?: Record<string, string>;
}
Restore PII
Reverses a redaction, substituting placeholders back to their original values using the mapping returned by Redact.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.pii.restore()
# Handle response
print(res)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.pii.restore({});
console.log(result);
}
run();
Show Parameters
Show Parameters
{
"redacted_text": Optional[str],
"mappings": Dict[str, str], # optional
}
{
redactedText?: string;
mappings?: Record<string, string>;
}
Show Response
Show Response
{
"original_text": Optional[str],
}
{
originalText?: string;
}