Setting the file. One moment.
Subchapter 4.5
references/sdk/azure-ai-contentsafety-ts.mdMarkdown1 KBView on GitHub
Condensed from azure-ai-contentsafety-ts. Full patterns (blocklist CRUD, image moderation, severity thresholds) in the plugin skill if installed.
npm install @azure-rest/ai-content-safety @azure/identity @azure/core-authimport ContentSafetyClient, { isUnexpected } from "@azure-rest/ai-content-safety";
import { AzureKeyCredential } from "@azure/core-auth";
const client = ContentSafetyClient(endpoint, new AzureKeyCredential(key));ContentSafetyClient is a function, not a classclient.path("/text:analyze").post({ body: { text, categories: [...] } })client.path("/image:analyze").post({ body: { image: { content: base64 } } }).path("/text/blocklists/{blocklistName}", name).patch({...})AzureKeyCredential from @azure/core-auth (not @azure/identity)isUnexpected() — type guard for error handling