Skip to content

Commit 8d90a43

Browse files
committed
add deploy step
1 parent 1f3937c commit 8d90a43

File tree

1 file changed

+70
-3
lines changed

1 file changed

+70
-3
lines changed

articles/ai-services/content-safety/how-to/incident-response.md

Lines changed: 70 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,43 @@ print(response.text)
152152
```
153153
---
154154

155+
### Deploy the incident
156+
157+
158+
Use the following command to deploy the incident, making it available for the analysis of new content.
159+
160+
#### [cURL](#tab/curl)
161+
162+
```shell
163+
curl --location 'https://<endpoint>/contentsafety/text/incidents/<text-incident-name>:deploy?api-version=2024-02-15-preview' \
164+
--header 'Ocp-Apim-Subscription-Key: <your-content-safety-key>' \
165+
--header 'Content-Type: application/json'
166+
```
167+
168+
#### [Python](#tab/python)
169+
170+
```python
171+
import requests
172+
import json
173+
174+
url = "https://<endpoint>/contentsafety/text/incidents/<text-incident-name>:deploy?api-version=2024-02-15-preview"
175+
176+
payload = {}
177+
headers = {
178+
'Ocp-Apim-Subscription-Key': '<your-content-safety-key>',
179+
'Content-Type': 'application/json'
180+
}
181+
182+
response = requests.request("POST", url, headers=headers, data=payload)
183+
184+
print(response.text)
185+
186+
```
187+
---
188+
155189
### Detect text incidents
156190

157-
Run the following command to analyze sample text content for the incident you just defined.
191+
Run the following command to analyze sample text content for the incident you just deployed.
158192

159193
#### [cURL](#tab/curl)
160194

@@ -313,9 +347,42 @@ print(response.text)
313347
```
314348
---
315349

316-
### Analyze image with incident response
350+
### Deploy the incident
351+
352+
Use the following command to deploy the incident, making it available for the analysis of new content.
353+
354+
#### [cURL](#tab/curl)
355+
356+
```shell
357+
curl --location 'https://<endpoint>/contentsafety/image/incidents/<image-incident-name>:deploy?api-version=2024-02-15-preview' \
358+
--header 'Ocp-Apim-Subscription-Key: <your-content-safety-key>' \
359+
--header 'Content-Type: application/json'
360+
```
361+
362+
#### [Python](#tab/python)
363+
364+
```python
365+
import requests
366+
import json
367+
368+
url = "https://<endpoint>/contentsafety/image/incidents/<image-incident-name>:deploy?api-version=2024-02-15-preview"
369+
370+
payload = {}
371+
headers = {
372+
'Ocp-Apim-Subscription-Key': '<your-content-safety-key>',
373+
'Content-Type': 'application/json'
374+
}
375+
376+
response = requests.request("POST", url, headers=headers, data=payload)
377+
378+
print(response.text)
379+
380+
```
381+
---
382+
383+
### Detect image incidents
317384

318-
Use the following command to upload a sample image and test it against the incient you created. You can either use a URL pointing to the image in an Azure blob storage container, or you can add the image data as a Base64 string.
385+
Use the following command to upload a sample image and test it against the incient you deployed. You can either use a URL pointing to the image in an Azure blob storage container, or you can add the image data as a Base64 string.
319386

320387
#### [cURL](#tab/curl)
321388

0 commit comments

Comments
 (0)