View source: R/content-safety-preview.R
| foundry_moderate_multimodal | R Documentation |
Analyze an image and optional accompanying text in a single multimodal Content Safety call. Optical character recognition can read text embedded in the image so that harmful captions or overlays are caught alongside the picture.
foundry_moderate_multimodal(
image,
text = NULL,
categories = c("Hate", "Sexual", "SelfHarm", "Violence"),
enable_ocr = TRUE,
endpoint = NULL,
api_key = NULL,
api_version = "2024-09-15-preview"
)
image |
Character. Local image path or HTTPS Azure Blob Storage URL. |
text |
Character. Optional text shown with the image (max 1,000 code points). |
categories |
Character vector of harm categories. Defaults to all four. |
enable_ocr |
Logical. When |
endpoint |
Character. Optional Content Safety endpoint. |
api_key |
Character. Optional Content Safety key. |
api_version |
Character. API version. Defaults to
|
A tibble with one row per harm category, matching
foundry_moderate_image(): source, category, severity, label, and
raw_response. Multimodal analysis returns four-level severities
(0, 2, 4, 6).
This operation is documented only in the Azure AI Content Safety Learn
quickstarts and has no published OpenAPI specification. It requires the
2024-09-15-preview api-version and, at time of writing, is available only
in a subset of Azure regions.
## Not run:
# Requires a configured Azure Content Safety endpoint and credentials
# with multimodal preview access, base64enc, and your meme.png input file.
foundry_moderate_multimodal(
image = "meme.png",
text = "caption under the image",
enable_ocr = TRUE
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.