foundry_protected_material: Detect protected material in text

View source: R/content-safety-extra.R

foundry_protected_materialR Documentation

Detect protected material in text

Description

Call the Azure AI Content Safety protected-material detector.

Usage

foundry_protected_material(
  text,
  endpoint = NULL,
  api_key = NULL,
  api_version = "2024-09-01"
)

Arguments

text

Character vector.

endpoint

Character. Optional Content Safety endpoint.

api_key

Character. Optional Content Safety key.

api_version

Character. API version. Defaults to "2024-09-01".

Value

A tibble with one row per input text.

Examples

# Requires a configured Azure Content Safety endpoint and credentials.
if (interactive() &&
    nzchar(Sys.getenv("AZURE_CONTENT_SAFETY_ENDPOINT")) &&
    nzchar(Sys.getenv("AZURE_CONTENT_SAFETY_KEY"))) {
  foundry_protected_material("A short text sample.")
}

foundryR documentation built on Sept. 25, 2026, 1:10 a.m.