View source: R/content-safety-preview.R
| foundry_protected_code | R Documentation |
Check source code for matches against public code repositories using the
Azure AI Content Safety protected-material-for-code detector. This is the
code counterpart to foundry_protected_material(), useful for flagging
LLM-generated code that reproduces licensed material.
foundry_protected_code(
code,
endpoint = NULL,
api_key = NULL,
api_version = "2024-09-15-preview"
)
code |
Character vector. One or more code snippets to check. |
endpoint |
Character. Optional Content Safety endpoint. Defaults to the
|
api_key |
Character. Optional Content Safety key. Defaults to the
|
api_version |
Character. API version. Defaults to
|
A tibble with one row per input snippet:
Character. The input snippet.
Logical. TRUE when protected material was detected.
List. A tibble of license and source_urls for each
matched code citation.
List. The parsed API response.
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 its contract may change.
## Not run:
# Requires a configured Azure Content Safety endpoint and credentials
# with access to the protected-code preview API.
foundry_protected_code("import pygame\npygame.init()")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.