@@ -119,6 +119,9 @@ The following section provides several code snippets covering some of the most c
119119#### Analyze text without blocklists
120120
121121``` typescript
122+ import ContentSafetyClient , { AnalyzeTextOptions , AnalyzeTextParameters , isUnexpected } from " @azure-rest/ai-content-safety" ;
123+ import { AzureKeyCredential } from " @azure/core-auth" ;
124+
122125const endpoint = process .env [" CONTENT_SAFETY_ENDPOINT" ] || " <endpoint>" ;
123126const key = process .env [" CONTENT_SAFETY_API_KEY" ] || " <key>" ;
124127
@@ -144,6 +147,9 @@ console.log("Violence severity: ", result.body.violenceResult?.severity);
144147#### Analyze text with blocklists
145148
146149``` typescript
150+ import ContentSafetyClient , { AnalyzeTextParameters , isUnexpected } from " @azure-rest/ai-content-safety" ;
151+ import { AzureKeyCredential } from " @azure/core-auth" ;
152+
147153const endpoint = process .env [" CONTENT_SAFETY_ENDPOINT" ] || " <endpoint>" ;
148154const key = process .env [" CONTENT_SAFETY_API_KEY" ] || " <key>" ;
149155
@@ -178,6 +184,9 @@ if (result.body.blocklistsMatchResults) {
178184### Analyze image
179185
180186``` typescript
187+ import ContentSafetyClient , { AnalyzeImageOptions , AnalyzeTextParameters , isUnexpected } from " @azure-rest/ai-content-safety" ;
188+ import { AzureKeyCredential } from " @azure/core-auth" ;
189+
181190const endpoint = process .env [" CONTENT_SAFETY_ENDPOINT" ] || " <endpoint>" ;
182191const key = process .env [" CONTENT_SAFETY_API_KEY" ] || " <key>" ;
183192
@@ -208,6 +217,9 @@ console.log("Violence severity: ", result.body.violenceResult?.severity);
208217#### Create or update text blocklist
209218
210219``` typescript
220+ import ContentSafetyClient , { CreateOrUpdateTextBlocklistParameters , isUnexpected } from " @azure-rest/ai-content-safety" ;
221+ import { AzureKeyCredential } from " @azure/core-auth" ;
222+
211223const endpoint = process .env [" CONTENT_SAFETY_ENDPOINT" ] || " <endpoint>" ;
212224const key = process .env [" CONTENT_SAFETY_API_KEY" ] || " <key>" ;
213225
@@ -235,6 +247,9 @@ console.log("Blocklist created or updated: Name", result.body.blocklistName, ",
235247#### List text blocklists
236248
237249``` typescript
250+ import ContentSafetyClient , { isUnexpected } from " @azure-rest/ai-content-safety" ;
251+ import { AzureKeyCredential } from " @azure/core-auth" ;
252+
238253const endpoint = process .env [" CONTENT_SAFETY_ENDPOINT" ] || " <endpoint>" ;
239254const key = process .env [" CONTENT_SAFETY_API_KEY" ] || " <key>" ;
240255
@@ -258,6 +273,9 @@ if (result.body.value) {
258273#### Get text blocklist
259274
260275``` typescript
276+ import ContentSafetyClient , { isUnexpected } from " @azure-rest/ai-content-safety" ;
277+ import { AzureKeyCredential } from " @azure/core-auth" ;
278+
261279const endpoint = process .env [" CONTENT_SAFETY_ENDPOINT" ] || " <endpoint>" ;
262280const key = process .env [" CONTENT_SAFETY_API_KEY" ] || " <key>" ;
263281
@@ -279,6 +297,9 @@ console.log("Name: ", result.body.blocklistName, ", Description: ", result.body.
279297#### Delete text blocklist
280298
281299``` typescript
300+ import ContentSafetyClient , { isUnexpected } from " @azure-rest/ai-content-safety" ;
301+ import { AzureKeyCredential } from " @azure/core-auth" ;
302+
282303const endpoint = process .env [" CONTENT_SAFETY_ENDPOINT" ] || " <endpoint>" ;
283304const key = process .env [" CONTENT_SAFETY_API_KEY" ] || " <key>" ;
284305
@@ -299,6 +320,9 @@ console.log("Deleted blocklist: ", blocklistName);
299320#### Add blockItems
300321
301322``` typescript
323+ import ContentSafetyClient , { AddBlockItemsParameters , isUnexpected } from " @azure-rest/ai-content-safety" ;
324+ import { AzureKeyCredential } from " @azure/core-auth" ;
325+
302326const endpoint = process .env [" CONTENT_SAFETY_ENDPOINT" ] || " <endpoint>" ;
303327const key = process .env [" CONTENT_SAFETY_API_KEY" ] || " <key>" ;
304328
@@ -340,6 +364,9 @@ if (result.body.value) {
340364#### List blockItems
341365
342366``` typescript
367+ import ContentSafetyClient , { isUnexpected } from " @azure-rest/ai-content-safety" ;
368+ import { AzureKeyCredential } from " @azure/core-auth" ;
369+
343370const endpoint = process .env [" CONTENT_SAFETY_ENDPOINT" ] || " <endpoint>" ;
344371const key = process .env [" CONTENT_SAFETY_API_KEY" ] || " <key>" ;
345372
@@ -365,6 +392,9 @@ if (result.body.value) {
365392#### Get blockItem
366393
367394``` typescript
395+ import ContentSafetyClient , { AddBlockItemsParameters , isUnexpected } from " @azure-rest/ai-content-safety" ;
396+ import { AzureKeyCredential } from " @azure/core-auth" ;
397+
368398const endpoint = process .env [" CONTENT_SAFETY_ENDPOINT" ] || " <endpoint>" ;
369399const key = process .env [" CONTENT_SAFETY_API_KEY" ] || " <key>" ;
370400
@@ -402,6 +432,9 @@ console.log("BlockItemId: ", blockItem.body.blockItemId, ", Text: ", blockItem.b
402432#### Remove blockItems
403433
404434``` typescript
435+ import ContentSafetyClient , { RemoveBlockItemsParameters , AddBlockItemsParameters , isUnexpected } from " @azure-rest/ai-content-safety" ;
436+ import { AzureKeyCredential } from " @azure/core-auth" ;
437+
405438const endpoint = process .env [" CONTENT_SAFETY_ENDPOINT" ] || " <endpoint>" ;
406439const key = process .env [" CONTENT_SAFETY_API_KEY" ] || " <key>" ;
407440
0 commit comments