SDK Reference
PII
SDK reference for the PII API, available in Node.js and Python.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Orq MCP is live: Use natural language to interrogate traces, spot regressions, and experiment your way to optimal AI configurations. Available in Claude Desktop, Claude Code, Cursor, and more. Start now →
SDK reference for the PII API, available in Node.js and Python.
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)
Show Parameters
{
"text": Optional[str],
"language": Optional[str],
"threshold": Optional[float],
"include_entities": Optional[bool],
}
Show Response
{
"has_pii": Optional[bool],
"entities": Dict[str, int],
}
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)
Show Parameters
{
"text": Optional[str],
"language": Optional[str],
"threshold": Optional[float],
}
Show Response
{
"redacted_text": Optional[str],
"mappings": Dict[str, str],
}
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)
Show Parameters
{
"redacted_text": Optional[str],
"mappings": Dict[str, str],
}
Show Response
{
"original_text": Optional[str],
}
Was this page helpful?