Skip to content

Commit 1f3937c

Browse files
committed
account for both image upload options
1 parent 878c981 commit 1f3937c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Follow these steps to define an incident with a few examples of text content and
3030
* An Azure subscription - [Create one for free](https://azure.microsoft.com/free/cognitive-services/)
3131
* Once you have your Azure subscription, <a href="https://aka.ms/acs-create" title="Create a Content Safety resource" target="_blank">create a Content Safety resource </a> in the Azure portal to get your key and endpoint. Enter a unique name for your resource, select your subscription, and select a resource group, supported region (East US or Sweden Central), and supported pricing tier. Then select **Create**.
3232
* The resource takes a few minutes to deploy. After it finishes, Select **go to resource**. In the left pane, under **Resource Management**, select **Subscription Key and Endpoint**. The endpoint and either of the keys are used to call APIs.
33-
* also create a blob storage container tbd
33+
* Also create a blob storage container if you want to upload your images there. You can also encode your images as Base64 strings and use them directly in the API calls.
3434
* One of the following installed:
3535
* [cURL](https://curl.haxx.se/) for REST API calls.
3636
* [Python 3.x](https://www.python.org/) installed
@@ -275,7 +275,7 @@ curl --location 'https://<endpoint>/contentsafety/image/incidents/<image-inciden
275275
"IncidentSamples": [
276276
{
277277
"image": {
278-
"content": "",
278+
"content": "<base64-data>",
279279
"bloburl": "<your-blob-storage-url>.png"
280280
}
281281
}
@@ -295,7 +295,7 @@ payload = json.dumps({
295295
"IncidentSamples": [
296296
{
297297
"image": {
298-
"content": "",
298+
"content": "<base64-data>",
299299
"bloburl": "<your-blob-storage-url>/image.png"
300300
}
301301
}
@@ -315,7 +315,7 @@ print(response.text)
315315

316316
### Analyze image with incident response
317317

318-
Use the following command to upload a sample image and test it against the incient you created.
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.
319319

320320
#### [cURL](#tab/curl)
321321

@@ -326,7 +326,7 @@ curl --location 'https://<endpoint>/contentsafety/image:detectIncidents?api-vers
326326
--data '{
327327
"image": {
328328
"url": "<your-blob-storage-url>/image.png",
329-
"content": ""
329+
"content": "<base64-data>"
330330
},
331331
"incidentNames": [
332332
"<image-incident-name>"
@@ -346,7 +346,7 @@ url = "https://<endpoint>/contentsafety/image:detectIncidents?api-version=2024-0
346346
payload = json.dumps({
347347
"image": {
348348
"url": "<your-blob-storage-url>/image.png",
349-
"content": ""
349+
"content": "<base64-data>"
350350
},
351351
"incidentNames": [
352352
"<image-incident-name>"

0 commit comments

Comments
 (0)