From 87e46c2a10b8a6d54ac45522659ec0bc9197de39 Mon Sep 17 00:00:00 2001 From: mengaims <50131889+mengaims@users.noreply.github.com> Date: Thu, 11 Jan 2024 20:39:47 +0800 Subject: [PATCH] Add private preview versions to feature branch (#43) (#27352) * Add ga contract for Content Safety * Update examples for 2023-10-01 * Resolve ModelValidation SpellCheck and Avocado * Fix typo * Fix minor errors in example and readme * Fix example * remove the 0430 content * update readme * re-format markdowm * Fix example * init content safety 2023-10-15-preview * init content safety 2023-10-15-previwe * update * format example * update read me file * update * update * update contract * update * update * update threshold * update new contract by add judgement kind enum * update description * u * update * updat length * update * update * update description for accept severity threshodl * update * merge with acs-ga * Add snippy contract * remove 8 sev levels for image * update contentsafety.json * Update snippy path * add type spec for jailbreak * Add incident response API in 2023-10-30-preview * compiled * Adaptive annotation service contract * Remove operations * update * update * refine * update * make 0,1,2,3,4,5,6,7 to 0, 1, 2, 3, ... and add comman in last enum value * update path * Update NL Snippy path * Resolve conflict * add * add * remove labelName * Fix route and minor errors * Change typo * update * Update protected material API * update project sample * Change path name * Update protect material contract * update jailbreak * Update incident contract * Update contract * Update * scenarios to enumerations (#19) * Remove project related contract (#20) * Remove project related things * Remove accepted * Remove examples * Merge 1015 (#22) * Add ga contract for Content Safety * Update examples for 2023-10-01 * Resolve ModelValidation SpellCheck and Avocado * Fix typo * Fix minor errors in example and readme * Fix example * remove the 0430 content * update readme * re-format markdowm * Fix example * init content safety 2023-10-15-preview * init content safety 2023-10-15-previwe * update * format example * update read me file * update * update * update contract * update * update * update threshold * update new contract by add judgement kind enum * update description * u * update * updat length * update * update * update description for accept severity threshodl * update * merge with acs-ga * Add snippy contract * remove 8 sev levels for image * update contentsafety.json * Update snippy path * add type spec for jailbreak * compiled * update * update * refine * update * make 0,1,2,3,4,5,6,7 to 0, 1, 2, 3, ... and add comman in last enum value * update path * Update NL Snippy path * Resolve conflict * Update protected material API * update project sample * Change path name * Update protect material contract * update jailbreak * Remove project related contract (#20) * Remove project related things * Remove accepted * Remove examples --------- * Add list API for Annotation Service (#23) * Add ga contract for Content Safety * Update examples for 2023-10-01 * Resolve ModelValidation SpellCheck and Avocado * Fix typo * Fix minor errors in example and readme * Fix example * remove the 0430 content * update readme * re-format markdowm * Fix example * init content safety 2023-10-15-preview * init content safety 2023-10-15-previwe * update * format example * update read me file * update * update * update contract * update * update * update threshold * update new contract by add judgement kind enum * update description * u * update * updat length * update * update * update description for accept severity threshodl * update * merge with acs-ga * Add snippy contract * remove 8 sev levels for image * update contentsafety.json * Update snippy path * add type spec for jailbreak * compiled * update * update * refine * update * make 0,1,2,3,4,5,6,7 to 0, 1, 2, 3, ... and add comman in last enum value * update path * Update NL Snippy path * Resolve conflict * Update protected material API * update project sample * Change path name * Update protect material contract * update jailbreak * Remove project related contract (#20) * Remove project related things * Remove accepted * Remove examples * Add list category APIs --------- * Update contract for incident response (#24) * scenarios to enumerations (#25) * [Cognitive Services - Azure AI Content Safety] - 2023-11-30-preview Private Preview * update doc * resolve comments. * Merge main and recompile swagger * add explanation for 2023-11-30-preview * format * generate swagger * Optimize contract (#36) * add 12-30-preview, add explanation spec * update * renamed reason -> harmful chunks * update. * remove new version enum from GA version * Remove examples from 1015 * restore examples * Add examples for jailbreak and protected material * run prettier for example * commit add enum to stable * Add omit-unreachable-types: true to typespec * compile preview * Fix readme * renamed to citation * UPDATE: add reasoning column and update some docs. * update doc. * update api version. * Fix some typo issues. (#40) * Update data plane. * Remove unused versions --------- Co-authored-by: FAREAST\suxi Co-authored-by: Lixiang Liu Co-authored-by: Lixiang Liu Co-authored-by: zhaiyutong Co-authored-by: YUTONG_ZHAI <32332316+zhaiyutong@users.noreply.github.com> Co-authored-by: Jie Zhou Co-authored-by: Yuxiao Wang Co-authored-by: Yuxiao Wang <58904990+Sayaka-4987@users.noreply.github.com> Co-authored-by: jiezhou_microsoft <94604058+JieZhou000@users.noreply.github.com> --- .../AddOrUpdateBlocklistItems.json | 30 + .../2023-10-30-preview/AnalyzeImage.json | 36 + .../2023-10-30-preview/AnalyzeText.json | 38 + .../CreateOrUpdateTextBlocklist.json | 25 + .../DeleteTextBlocklist.json | 11 + .../2023-10-30-preview/GetTextBlocklist.json | 16 + .../GetTextBlocklistItem.json | 18 + .../ListTextBlocklistItems.json | 21 + .../ListTextBlocklists.json | 19 + .../RemoveBlocklistItems.json | 16 + .../cognitiveservices/ContentSafety/main.tsp | 6 + .../ContentSafety/models.tsp | 389 +++ .../ContentSafety/routes.tsp | 174 + .../2023-10-30-preview/contentsafety.json | 3102 +++++++++++++++++ .../examples/AddOrUpdateBlocklistItems.json | 30 + .../examples/AnalyzeImage.json | 36 + .../examples/AnalyzeText.json | 38 + .../examples/CreateOrUpdateTextBlocklist.json | 25 + .../examples/DeleteTextBlocklist.json | 11 + .../examples/GetTextBlocklist.json | 16 + .../examples/GetTextBlocklistItem.json | 18 + .../examples/ListTextBlocklistItems.json | 21 + .../examples/ListTextBlocklists.json | 19 + .../examples/RemoveBlocklistItems.json | 16 + .../2024-01-30-preview/contentsafety.json | 3059 ++++++++++++++++ .../data-plane/ContentSafety/readme.md | 2 +- 26 files changed, 7191 insertions(+), 1 deletion(-) create mode 100644 specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/AddOrUpdateBlocklistItems.json create mode 100644 specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/AnalyzeImage.json create mode 100644 specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/AnalyzeText.json create mode 100644 specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/CreateOrUpdateTextBlocklist.json create mode 100644 specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/DeleteTextBlocklist.json create mode 100644 specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/GetTextBlocklist.json create mode 100644 specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/GetTextBlocklistItem.json create mode 100644 specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/ListTextBlocklistItems.json create mode 100644 specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/ListTextBlocklists.json create mode 100644 specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/RemoveBlocklistItems.json create mode 100644 specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/contentsafety.json create mode 100644 specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/AddOrUpdateBlocklistItems.json create mode 100644 specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/AnalyzeImage.json create mode 100644 specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/AnalyzeText.json create mode 100644 specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/CreateOrUpdateTextBlocklist.json create mode 100644 specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/DeleteTextBlocklist.json create mode 100644 specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/GetTextBlocklist.json create mode 100644 specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/GetTextBlocklistItem.json create mode 100644 specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/ListTextBlocklistItems.json create mode 100644 specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/ListTextBlocklists.json create mode 100644 specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/RemoveBlocklistItems.json create mode 100644 specification/cognitiveservices/data-plane/ContentSafety/preview/2024-01-30-preview/contentsafety.json diff --git a/specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/AddOrUpdateBlocklistItems.json b/specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/AddOrUpdateBlocklistItems.json new file mode 100644 index 000000000000..c7353595d2ef --- /dev/null +++ b/specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/AddOrUpdateBlocklistItems.json @@ -0,0 +1,30 @@ +{ + "title": "Add or Update BlocklistItems To Text Blocklist", + "operationId": "TextBlocklists_AddOrUpdateBlocklistItems", + "parameters": { + "api-version": "2023-12-30-preview", + "blocklistName": "TestBlocklist", + "body": { + "blocklistItems": [ + { + "blocklistItemId": null, + "description": "Hate word", + "text": "hate" + } + ] + } + }, + "responses": { + "200": { + "body": { + "blocklistItems": [ + { + "blocklistItemId": "9511969e-f1e3-4604-9127-05ee16c509ec", + "description": "Hate word", + "text": "hate" + } + ] + } + } + } +} diff --git a/specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/AnalyzeImage.json b/specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/AnalyzeImage.json new file mode 100644 index 000000000000..0d447cf2bab2 --- /dev/null +++ b/specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/AnalyzeImage.json @@ -0,0 +1,36 @@ +{ + "title": "Analyze Image", + "operationId": "ImageOperations_AnalyzeImage", + "parameters": { + "api-version": "2023-12-30-preview", + "body": { + "image": { + "content": "Y29udGVudDE=" + } + } + }, + "responses": { + "200": { + "body": { + "categoriesAnalysis": [ + { + "category": "Hate", + "severity": 0 + }, + { + "category": "SelfHarm", + "severity": 0 + }, + { + "category": "Sexual", + "severity": 0 + }, + { + "category": "Violence", + "severity": 2 + } + ] + } + } + } +} diff --git a/specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/AnalyzeText.json b/specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/AnalyzeText.json new file mode 100644 index 000000000000..c15ad6ccad29 --- /dev/null +++ b/specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/AnalyzeText.json @@ -0,0 +1,38 @@ +{ + "title": "Analyze Text", + "operationId": "TextOperations_AnalyzeText", + "parameters": { + "api-version": "2023-12-30-preview", + "body": { + "text": "This is text example. A hate speech sentence. A sentence with a violent description." + } + }, + "responses": { + "200": { + "body": { + "blocklistsMatch": [], + "categoriesAnalysis": [{ + "category": "Hate", + "severity": 0 + }, + { + "category": "SelfHarm", + "severity": 0 + }, + { + "category": "Sexual", + "severity": 0 + }, + { + "category": "Violence", + "severity": 0 + } + ], + "citation": [ + "A hate speech sentence", + "A sentence with a violent description" + ] + } + } + } +} diff --git a/specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/CreateOrUpdateTextBlocklist.json b/specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/CreateOrUpdateTextBlocklist.json new file mode 100644 index 000000000000..c8950fe923b6 --- /dev/null +++ b/specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/CreateOrUpdateTextBlocklist.json @@ -0,0 +1,25 @@ +{ + "title": "Create Or Update Text Blocklist", + "operationId": "TextBlocklists_CreateOrUpdateTextBlocklist", + "parameters": { + "api-version": "2023-12-30-preview", + "blocklistName": "TestBlocklist", + "resource": { + "description": "Test Blocklist" + } + }, + "responses": { + "200": { + "body": { + "blocklistName": "TestBlocklist", + "description": "Test Blocklist" + } + }, + "201": { + "body": { + "blocklistName": "TestBlocklist", + "description": "Test Blocklist" + } + } + } +} diff --git a/specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/DeleteTextBlocklist.json b/specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/DeleteTextBlocklist.json new file mode 100644 index 000000000000..30af65c0662d --- /dev/null +++ b/specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/DeleteTextBlocklist.json @@ -0,0 +1,11 @@ +{ + "title": "Delete Text Blocklist By blocklistName", + "operationId": "TextBlocklists_DeleteTextBlocklist", + "parameters": { + "api-version": "2023-12-30-preview", + "blocklistName": "TestBlocklist" + }, + "responses": { + "204": {} + } +} diff --git a/specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/GetTextBlocklist.json b/specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/GetTextBlocklist.json new file mode 100644 index 000000000000..73786c7a4c36 --- /dev/null +++ b/specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/GetTextBlocklist.json @@ -0,0 +1,16 @@ +{ + "title": "Get Text Blocklist By blocklistName", + "operationId": "TextBlocklists_GetTextBlocklist", + "parameters": { + "api-version": "2023-12-30-preview", + "blocklistName": "TestBlocklist" + }, + "responses": { + "200": { + "body": { + "blocklistName": "TestBlocklist", + "description": "Test Blocklist" + } + } + } +} diff --git a/specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/GetTextBlocklistItem.json b/specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/GetTextBlocklistItem.json new file mode 100644 index 000000000000..c5e7eaf86b46 --- /dev/null +++ b/specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/GetTextBlocklistItem.json @@ -0,0 +1,18 @@ +{ + "title": "Get BlockItem By blocklistName And blocklistItemId", + "operationId": "TextBlocklists_GetTextBlocklistItem", + "parameters": { + "api-version": "2023-12-30-preview", + "blocklistName": "TestBlocklist", + "blocklistItemId": "9511969e-f1e3-4604-9127-05ee16c509ec" + }, + "responses": { + "200": { + "body": { + "blocklistItemId": "9511969e-f1e3-4604-9127-05ee16c509ec", + "description": "Hate word", + "text": "hate" + } + } + } +} diff --git a/specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/ListTextBlocklistItems.json b/specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/ListTextBlocklistItems.json new file mode 100644 index 000000000000..13352ef1692c --- /dev/null +++ b/specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/ListTextBlocklistItems.json @@ -0,0 +1,21 @@ +{ + "title": "Get All BlockItems By blocklistName", + "operationId": "TextBlocklists_ListTextBlocklistItems", + "parameters": { + "api-version": "2023-12-30-preview", + "blocklistName": "TestBlocklist" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "blocklistItemId": "9511969e-f1e3-4604-9127-05ee16c509ec", + "description": "Hate word", + "text": "hate" + } + ] + } + } + } +} diff --git a/specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/ListTextBlocklists.json b/specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/ListTextBlocklists.json new file mode 100644 index 000000000000..65dc19eec7b3 --- /dev/null +++ b/specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/ListTextBlocklists.json @@ -0,0 +1,19 @@ +{ + "title": "Get All Text Blocklists", + "operationId": "TextBlocklists_ListTextBlocklists", + "parameters": { + "api-version": "2023-12-30-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "blocklistName": "TestBlocklist", + "description": "Test Blocklist" + } + ] + } + } + } +} diff --git a/specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/RemoveBlocklistItems.json b/specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/RemoveBlocklistItems.json new file mode 100644 index 000000000000..a9a603bc3d80 --- /dev/null +++ b/specification/cognitiveservices/ContentSafety/examples/2023-10-30-preview/RemoveBlocklistItems.json @@ -0,0 +1,16 @@ +{ + "title": "Remove BlockItems From Text Blocklist", + "operationId": "TextBlocklists_RemoveBlocklistItems", + "parameters": { + "api-version": "2023-12-30-preview", + "blocklistName": "TestBlocklist", + "body": { + "blocklistItemIds": [ + "9511969e-f1e3-4604-9127-05ee16c509ec" + ] + } + }, + "responses": { + "204": {} + } +} diff --git a/specification/cognitiveservices/ContentSafety/main.tsp b/specification/cognitiveservices/ContentSafety/main.tsp index dd5ca93f7cdb..f98389174c9b 100644 --- a/specification/cognitiveservices/ContentSafety/main.tsp +++ b/specification/cognitiveservices/ContentSafety/main.tsp @@ -44,4 +44,10 @@ enum Versions { @useDependency(Azure.Core.Versions.v1_0_Preview_2) v2023_10_15_Preview: "2023-10-15-preview", + + @useDependency(Azure.Core.Versions.v1_0_Preview_2) + v2023_10_30_Preview: "2023-10-30-preview", + + @useDependency(Azure.Core.Versions.v1_0_Preview_2) + v2024_01_30_Preview: "2024-01-30-preview", } diff --git a/specification/cognitiveservices/ContentSafety/models.tsp b/specification/cognitiveservices/ContentSafety/models.tsp index 933b73365870..6459f69d9e01 100644 --- a/specification/cognitiveservices/ContentSafety/models.tsp +++ b/specification/cognitiveservices/ContentSafety/models.tsp @@ -57,6 +57,20 @@ model AnalyzeTextOptions { @doc("This refers to the type of text analysis output. If no value is assigned, the default value will be \"FourSeverityLevels\".") outputType?: AnalyzeTextOutputType = AnalyzeTextOutputType.FourSeverityLevels; + + @added(ContentSafety.Versions.v2023_10_30_Preview) + @doc("The incidents to detect.") + incidents?: IncidentOptions; +} + +@added(ContentSafety.Versions.v2023_10_30_Preview) +@doc("The text analysis request.") +model IncidentOptions { + @doc("The accept decision made by service.") + incidentNames?: string[]; + + @doc("When set to true, further analyses of harmful content will not be performed in cases where incidents are hit. When set to false, all analyses of harmful content will be performed, whether or not incidents are hit.") + haltOnIncidentHit?: boolean; } @doc("The text analysis response.") @@ -66,6 +80,14 @@ model AnalyzeTextResult { @doc("Analysis result for categories.") categoriesAnalysis: TextCategoriesAnalysis[]; + + @added(ContentSafety.Versions.v2023_10_30_Preview) + @doc("The incident match details.") + incidentMatches?: IncidentMatch[]; + + @added(ContentSafety.Versions.v2024_01_30_Preview) + @doc("Chunks in the original text detected as harmful content. Analysis result and scores are caused by these.") + citation?: string[]; } @doc("The result of blocklist match.") @@ -92,6 +114,14 @@ model TextCategoriesAnalysis { severity?: int32; } +@added(ContentSafety.Versions.v2023_10_30_Preview) +@doc("The result of text incident match.") +model IncidentMatch { + @doc("The name of the matched incident.") + @maxLength(64) + incidentName: string; +} + @doc("The image analysis request.") model AnalyzeImageOptions { @doc("The image needs to be analyzed.") @@ -102,6 +132,10 @@ model AnalyzeImageOptions { @doc("This refers to the type of image analysis output. If no value is assigned, the default value will be \"FourSeverityLevels\".") outputType?: AnalyzeImageOutputType = AnalyzeImageOutputType.FourSeverityLevels; + + @added(ContentSafety.Versions.v2023_10_30_Preview) + @doc("The incidents to detect.") + incidents?: IncidentOptions; } @doc("The image can be either base64 encoded bytes or a blob URL. You can choose only one of these options. If both are provided, the request will be refused. The maximum image size is 2048 x 2048 pixels and should not exceed 4 MB, while the minimum image size is 50 x 50 pixels.") @@ -120,6 +154,10 @@ model ImageData { model AnalyzeImageResult { @doc("Analysis result for categories.") categoriesAnalysis: ImageCategoriesAnalysis[]; + + @added(ContentSafety.Versions.v2023_10_30_Preview) + @doc("The incident match details.") + incidentMatches?: IncidentMatch[]; } @doc("Image analysis result.") @@ -228,3 +266,354 @@ model JailbreakAnalysisResult { @doc("Analysis result for jailbreak.") detected: boolean; } + +@added(ContentSafety.Versions.v2023_10_30_Preview) +@doc("Text Incident.") +@resource("text/incidents") +model TextIncident { + @doc("incident name.") + @pattern("^[0-9A-Za-z._~-]+$") + @key("incidentName") + @visibility("read", "create", "query") + @maxLength(64) + incidentName: string; + + @doc("Incident description.") + @maxLength(1024) + description?: string; + + @doc("Incident created time.") + @visibility("read", "query") + created: utcDateTime; + + @doc("Incident updated time.") + @visibility("read", "query") + lastUpdated: utcDateTime; +} + +@added(ContentSafety.Versions.v2023_10_30_Preview) +@doc("Sample in a Text Incident.") +@resource("incidentSamples") +@parentResource(TextIncident) +model TextIncidentSample { + @doc("incident name.") + @key("incidentSampleId") + @visibility("read") + @maxLength(64) + incidentSampleId: string; + + @doc("IncidentSample text content.") + @maxLength(1024) + text?: string; +} + +@added(ContentSafety.Versions.v2023_10_30_Preview) +@doc("The request to add incidentSamples to a incident.") +model AddTextIncidentSamplesOptions { + @doc("Array of incidentSamples to add.") + incidentSamples: TextIncidentSample[]; +} + +@added(ContentSafety.Versions.v2023_10_30_Preview) +@doc("The response of adding incidentSamples to the incident.") +model AddTextIncidentSamplesResult { + @doc("Array of incidentSamples have been added.") + incidentSamples: TextIncidentSample[]; +} + +@added(ContentSafety.Versions.v2023_10_30_Preview) +@doc("The request to remove incidentSamples from a incident.") +model RemoveTextIncidentSamplesOptions { + @doc("Array of incidentSamples to remove.") + incidentSampleIds: string[]; +} + +@added(ContentSafety.Versions.v2023_10_30_Preview) +@doc("Image Incident.") +@resource("image/incidents") +model ImageIncident { + @doc("incident name.") + @pattern("^[0-9A-Za-z._~-]+$") + @key("incidentName") + @visibility("read", "create", "query") + @maxLength(64) + incidentName: string; + + @doc("Incident description.") + @maxLength(1024) + description?: string; + + @doc("Incident created time.") + @visibility("read", "query") + created: utcDateTime; + + @doc("Incident updated time.") + @visibility("read", "query") + lastUpdated: utcDateTime; +} + +@added(ContentSafety.Versions.v2023_10_30_Preview) +@doc("Sample in an Image Incident.") +@resource("incidentSamples") +@parentResource(ImageIncident) +model ImageIncidentSample { + @doc("incident name.") + @key("incidentSampleId") + @visibility("read") + @maxLength(64) + incidentSampleId: string; + + @doc("IncidentSample image content.") + image?: ImageData; +} + +@added(ContentSafety.Versions.v2023_10_30_Preview) +@doc("The image result is base64 encoded bytes") +@projectedName("csharp", "ContentSafetyImageDataResult") +model ImageDataResult { + @doc("The Base64 encoding of the image.") + content?: bytes; +} + +@added(ContentSafety.Versions.v2023_10_30_Preview) +@doc("Sample Result in an Image Incident.") +@resource("incidentSamples") +@parentResource(ImageIncident) +model ImageIncidentSampleResult { + @doc("incident name.") + @key("incidentSampleId") + @visibility("read") + @maxLength(64) + incidentSampleId: string; + + @doc("IncidentSample image content.") + image?: ImageDataResult; +} + +@added(ContentSafety.Versions.v2023_10_30_Preview) +@doc("The request to add incidentSamples to a incident.") +model AddImageIncidentSamplesOptions { + @doc("Array of incidentSamples to add.") + incidentSamples: ImageIncidentSample[]; +} + +@added(ContentSafety.Versions.v2023_10_30_Preview) +@doc("The request to remove incidentSamples from a incident.") +model RemoveImageIncidentSamplesOptions { + @doc("Array of incidentSamples to remove.") + incidentSampleIds: string[]; +} + +@added(ContentSafety.Versions.v2023_10_30_Preview) +@doc("Sample in a Image Incident.") +@resource("incidentSamples") +@parentResource(ImageIncident) +model ListImageIncidentSampleResult { + @doc("incident name.") + @key("incidentSampleId") + @visibility("read") + @maxLength(64) + incidentSampleId: string; +} + +@added(ContentSafety.Versions.v2023_10_30_Preview) +@doc("The response of adding incidentSamples to the incident.") +model AddImageIncidentSamplesResult { + @doc("Array of incidentSamples have been added.") + incidentSamples: ListImageIncidentSampleResult[]; +} + +@doc("Annotate text options") +@added(Versions.v2023_10_30_Preview) +model AnnotateTextOptions { + @doc("The text needs to be analyzed. We support a maximum of 10k Unicode characters (Unicode code points) in the text of one request.") + @maxLength(10000) + text: string; + + @doc("The category will be analyzed, you can set your customized category or one of built-in categories in 'Hate','Selfharm', 'Sexual' and 'Violence'.") + category: string; +} + +@doc("The text annotation response.") +@added(Versions.v2023_10_30_Preview) +model AnnotateTextResult { + @doc("The id of annotated subcategory.") + id: int32; + + @doc("The name of annotated subcategory.") + name: string; + + @doc("The reasoning.") + reasoning?: string; +} + +@added(Versions.v2023_10_30_Preview) +@doc("Pre-defined concept.") +model PreDefinedConcept { + concept: string; + description: string; +} + +@added(Versions.v2023_10_30_Preview) +@doc("Label definition.") +model SubCategory { + id: int32; + name: string; + statements: string[]; +} + +@added(Versions.v2023_10_30_Preview) +@doc("Text Customized categories.") +@resource("text/categories") +model TextCustomizedCategory { + @doc("Text customizedCategories name.") + @pattern("^Customized_[0-9A-Za-z._~-]+$") + @key("categoryName") + @visibility("read", "create", "query") + @maxLength(64) + categoryName: string; + + preDefinedConcepts?: PreDefinedConcept[]; + subCategories: SubCategory[]; + emphases?: string[]; + exampleBlobUrl?: url; +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "MUST fix in next update" +@added(ContentSafety.Versions.v2023_10_30_Preview) +@doc("ImageWithText analyze category.") +enum ImageWithTextCategory { + Hate, + SelfHarm, + Sexual, + Violence, +} + +@added(ContentSafety.Versions.v2023_10_30_Preview) +@doc("The analysis request of the image with text.") +model AnalyzeImageWithTextOptions { + @doc("The image needs to be analyzed.") + image: ImageData; + + @doc("The text attached to the image. We support at most 1k characters (unicode code points) in one text request.") + @maxLength(1000) + text?: string; + + @doc("The categories will be analyzed. If they are not assigned, a default set of analysis results for the categories will be returned.") + categories?: ImageWithTextCategory[]; + + @doc("When set to true, our service will perform OCR and concatenate the recognized text with input text before analyzing. We will recognize at most 256 characters (unicode code points) from input image. The others will be truncated.") + enableOcr: boolean; +} + +@added(Versions.v2023_10_30_Preview) +@doc("ImageWithText analysis result.") +model ImageWithTextCategoriesAnalysis { + @doc("The imageWithtext analysis category.") + category: ImageWithTextCategory; + + @doc("The higher the severity of input content, the larger this value is. The values could be: 0,2,4,6.") + severity?: int32; +} + +@added(Versions.v2023_10_30_Preview) +@doc("The analysis response of the image with text.") +model AnalyzeImageWithTextResult { + @doc("Analysis result for categories.") + categoriesAnalysis: ImageWithTextCategoriesAnalysis[]; +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "MUST fix in next update" +@added(ContentSafety.Versions.v2023_10_30_Preview) +@doc("Domain.") +enum Domain { + Generic, + Medical, +} + +#suppress "@azure-tools/typespec-azure-core/documentation-required" "MUST fix in next update" +@added(ContentSafety.Versions.v2023_10_30_Preview) +@doc("Task type.") +enum Task { + Summarization, + QnA, +} + +@added(Versions.v2023_10_30_Preview) +@doc("Connection details for the GPT resource.") +model GptResource { + @doc("Endpoint for Azure OpenAI resource.") + azureOpenAIEndpoint: string; + + @doc("Deployment model name.") + deploymentName: string; +} + +@added(Versions.v2023_10_30_Preview) +@doc("The request of ungroundedness detection.") +model DetectUngroundednessOptions { + @doc(""" + The domain of the text for analysis. + This field is optional, with a default value of Generic. + """) + domain?: Domain; + + @doc(""" + The task type for the text analysis. + This field is optional, with a default value of Summarization. + """) + task?: Task; + + @doc(""" + The user's question input in a QnA scenario. + This field is optional, but if the task type is set to QnA, it becomes required. + """) + query?: string; + + @doc("The text requiring analysis.") + text: string; + + @doc("The source information used as a grounding reference.") + groundingSources: string[]; + + @doc(""" + A value indicating if the output includes an explanation for the identified ungroundedness. + This field is optional, with a default value of false. + """) + reasoning?: boolean; + + @doc(""" + Connection details for the GPT resource. + This field will be used only when the 'reasoning' field is set to true; otherwise, it will be ignored. + """) + gptResource?: GptResource; +} + +@added(Versions.v2023_10_30_Preview) +@doc("The detailed information about a text identified as ungrounded.") +model UngroundedDetails { + @doc("The ungrounded text.") + text: string; + + @doc(""" + The explanation for identifying the text as ungrounded. + Only when the 'reasoning' field in the input is set to true 'reason' field will be returned. + """) + reason?: string; +} + +@added(Versions.v2023_10_30_Preview) +@doc("The response of ungroundedness detection.") +model DetectUngroundednessResult { + @doc("Detection result for ungrounded text.") + ungrounded: boolean; + + @doc("Confidence score of the model in the analysis results.") + confidenceScore: float32; + + @doc("Percentage of ungrounded Text.") + ungroundedPercentage: float32; + + @doc("The detailed information about a text identified as ungrounded.") + ungroundedDetails: UngroundedDetails[]; +} diff --git a/specification/cognitiveservices/ContentSafety/routes.tsp b/specification/cognitiveservices/ContentSafety/routes.tsp index 44166e23feff..6e0b436297b0 100644 --- a/specification/cognitiveservices/ContentSafety/routes.tsp +++ b/specification/cognitiveservices/ContentSafety/routes.tsp @@ -149,3 +149,177 @@ interface TextBlocklists { ListQueryParametersTrait >; } + +interface TextIncidentOps + extends Azure.Core.ResourceOperations {} + +@added(ContentSafety.Versions.v2023_10_30_Preview) +interface TextIncidents { + @summary("Get Text Incident By incidentName") + @doc("Returns text incident details.") + getIncidents is TextIncidentOps.ResourceRead; + + @summary("Create Or Update Text Incident") + @doc("Updates a text incident. If the text incident does not exist, a new text incident will be created.") + createOrUpdateIncident is TextIncidentOps.ResourceCreateOrUpdate; + + @summary("Delete Text Incident By incidentName") + @doc("Deletes a text incident.") + deleteIncident is TextIncidentOps.ResourceDelete; + + @summary("Get All Text Incidents") + @doc("Get all incidents details.") + listIncidents is TextIncidentOps.ResourceList< + TextIncident, + ListQueryParametersTrait + >; + + @summary("Add TextIncidentSamples To Incident") + @doc("Add textIncidentSamples to an incident. You can add at most 100 textIncidentSamples in one request.") + addIncidentSamples is TextIncidentOps.ResourceAction< + TextIncident, + AddTextIncidentSamplesOptions, + AddTextIncidentSamplesResult + >; + + @summary("Remove TextIncidentSamples From Incident") + @doc("Remove textIncidentSamples from an incident. You can remove at most 100 Text Incident in one request.") + removeIncidentSamples is TextIncidentOps.ResourceAction< + TextIncident, + RemoveTextIncidentSamplesOptions, + NoContentResponse + >; + + @summary("Get TextIncidentSample By textIncidentName And textIncidentSampleId") + @doc("Get textIncidentSample by textIncidentName and textIncidentSampleId from a text incident.") + getIncidentSample is TextIncidentOps.ResourceRead; + + @summary("Get All TextIncidentSamples By textIncidentName") + @doc("Get all TextIncidentSamples in a text incident.") + listIncidentSamples is TextIncidentOps.ResourceList< + TextIncidentSample, + ListQueryParametersTrait + >; +} + +interface ImageIncidentOps + extends Azure.Core.ResourceOperations {} + +@added(ContentSafety.Versions.v2023_10_30_Preview) +interface ImageIncidents { + @summary("Get Image Incident By incidentName") + @doc("Returns image incident details.") + getIncidents is ImageIncidentOps.ResourceRead; + + @summary("Create Or Update Image Incident") + @doc("Updates a image incident. If the image incident does not exist, a new image incident will be created.") + createOrUpdateIncident is ImageIncidentOps.ResourceCreateOrUpdate; + + @summary("Delete Image Incident By incidentName") + @doc("Deletes a image incident.") + deleteIncident is ImageIncidentOps.ResourceDelete; + + @summary("Get All Image Incidents") + @doc("Get all incidents details.") + listIncidents is ImageIncidentOps.ResourceList< + ImageIncident, + ListQueryParametersTrait + >; + + @summary("Add ImageIncidentSamples To Incident") + @doc("Add imageIncidentSamples to an incident. You can add at most 100 imageIncidentSamples in one request.") + addIncidentSamples is ImageIncidentOps.ResourceAction< + ImageIncident, + AddImageIncidentSamplesOptions, + AddImageIncidentSamplesResult + >; + + @summary("Remove ImageIncidentSamples From Incident") + @doc("Remove imageIncidentSamples from an incident. You can remove at most 100 Image Incident in one request.") + removeIncidentSamples is ImageIncidentOps.ResourceAction< + ImageIncident, + RemoveImageIncidentSamplesOptions, + NoContentResponse + >; + + @summary("Get ImageIncidentSample By imageIncidentName And imageIncidentSampleId") + @doc("Get imageIncidentSample by imageIncidentName and imageIncidentSampleId from a image incident.") + getIncidentSample is ImageIncidentOps.ResourceRead; + + @summary("Get All ImageIncidentSamples By imageIncidentName") + @doc("Get all ImageIncidentSamples in a image incident.") + listIncidentSamples is ImageIncidentOps.ResourceList< + ListImageIncidentSampleResult, + ListQueryParametersTrait + >; +} + +@added(Versions.v2023_10_30_Preview) +interface PromptTextOperations { + @summary("Annotate Text by Prompt") + @route("/text:adaptiveAnnotate") + @post + annotateText is Azure.Core.RpcOperation< + { + @body + @doc("The text analysis request.") + body: AnnotateTextOptions; + }, + AnnotateTextResult + >; +} + +interface CategoryOps + extends Azure.Core.ResourceOperations {} + +@added(Versions.v2023_10_30_Preview) +interface TextCategoryCustomization { + createOrReplaceTextCustomizedCategory is CategoryOps.ResourceCreateOrReplace; + + getTextCustomizedCategory is CategoryOps.ResourceRead; + + deleteTextCustomizedCategory is CategoryOps.ResourceDelete; + + listTextCustomizedCategory is CategoryOps.ResourceList< + TextCustomizedCategory, + ListQueryParametersTrait + >; +} + +@added(Versions.v2023_10_30_Preview) +interface ImageWithTextOperations { + @summary("Analyze Image With Text") + @doc("A synchronous API for the analysis of potentially harmful image with text content. Currently, it supports four categories: Hate, SelfHarm, Sexual, and Violence.") + @route("/imageWithText:analyze") + @post + analyzeImageWithText is Azure.Core.RpcOperation< + { + @doc("The image with text analysis request.") + @body + body: AnalyzeImageWithTextOptions; + }, + AnalyzeImageWithTextResult + >; +} + +@added(Versions.v2023_10_30_Preview) +interface TextUngroundednessDetectionOperations { + @summary("Detect Ungrounded Information") + @doc("A synchronous API for the analysis of language model outputs to determine alignment with user-provided information or identify fictional content.") + @route("/text:detectUngroundedness") + @post + detectUngroundedness is Azure.Core.RpcOperation< + { + @body + @doc("The ungroundedness detection request.") + body: DetectUngroundednessOptions; + }, + DetectUngroundednessResult + >; +} diff --git a/specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/contentsafety.json b/specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/contentsafety.json new file mode 100644 index 000000000000..f4f32e3af776 --- /dev/null +++ b/specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/contentsafety.json @@ -0,0 +1,3102 @@ +{ + "swagger": "2.0", + "info": { + "title": "ContentSafety Service", + "version": "2023-10-30-preview", + "description": "Analyze harmful content", + "x-typespec-generated": [ + { + "emitter": "@azure-tools/typespec-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "x-ms-parameterized-host": { + "hostTemplate": "{endpoint}/contentsafety", + "useSchemePrefix": false, + "parameters": [ + { + "name": "endpoint", + "in": "path", + "description": "Supported Cognitive Services endpoints (protocol and hostname, for example:\nhttps://.cognitiveservices.azure.com).", + "required": true, + "type": "string" + } + ] + }, + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "security": [ + { + "ApiKeyAuth": [] + }, + { + "OAuth2Auth": [ + "https://cognitiveservices.azure.com/.default" + ] + } + ], + "securityDefinitions": { + "ApiKeyAuth": { + "type": "apiKey", + "name": "Ocp-Apim-Subscription-Key", + "in": "header" + }, + "OAuth2Auth": { + "type": "oauth2", + "flow": "application", + "scopes": { + "https://cognitiveservices.azure.com/.default": "" + }, + "tokenUrl": "https://login.microsoftonline.com/common/oauth2/v2.0/token" + } + }, + "tags": [], + "paths": { + "/image/incidents": { + "get": { + "operationId": "ImageIncidents_ListIncidents", + "summary": "Get All Image Incidents", + "description": "Get all incidents details.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "$ref": "#/parameters/Azure.Core.TopQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.SkipQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.MaxPageSizeQueryParameter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedImageIncident" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/image/incidents/{incidentName}": { + "get": { + "operationId": "ImageIncidents_GetIncidents", + "summary": "Get Image Incident By incidentName", + "description": "Returns image incident details.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "incidentName", + "in": "path", + "description": "incident name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/ImageIncident" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + }, + "patch": { + "operationId": "ImageIncidents_CreateOrUpdateIncident", + "summary": "Create Or Update Image Incident", + "description": "Updates a image incident. If the image incident does not exist, a new image incident will be created.", + "consumes": [ + "application/merge-patch+json" + ], + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "incidentName", + "in": "path", + "description": "incident name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + }, + { + "name": "resource", + "in": "body", + "description": "The resource instance.", + "required": true, + "schema": { + "$ref": "#/definitions/ImageIncidentCreateOrUpdate" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/ImageIncident" + } + }, + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "schema": { + "$ref": "#/definitions/ImageIncident" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + }, + "delete": { + "operationId": "ImageIncidents_DeleteIncident", + "summary": "Delete Image Incident By incidentName", + "description": "Deletes a image incident.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "incidentName", + "in": "path", + "description": "incident name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful. " + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/image/incidents/{incidentName}:addIncidentSamples": { + "post": { + "operationId": "ImageIncidents_AddIncidentSamples", + "summary": "Add ImageIncidentSamples To Incident", + "description": "Add imageIncidentSamples to an incident. You can add at most 100 imageIncidentSamples in one request.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "incidentName", + "in": "path", + "description": "incident name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AddImageIncidentSamplesOptions" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/AddImageIncidentSamplesResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/image/incidents/{incidentName}:removeIncidentSamples": { + "post": { + "operationId": "ImageIncidents_RemoveIncidentSamples", + "summary": "Remove ImageIncidentSamples From Incident", + "description": "Remove imageIncidentSamples from an incident. You can remove at most 100 Image Incident in one request.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "incidentName", + "in": "path", + "description": "incident name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RemoveImageIncidentSamplesOptions" + } + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful. " + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/image/incidents/{incidentName}/incidentSamples": { + "get": { + "operationId": "ImageIncidents_ListIncidentSamples", + "summary": "Get All ImageIncidentSamples By imageIncidentName", + "description": "Get all ImageIncidentSamples in a image incident.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "incidentName", + "in": "path", + "description": "incident name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + }, + { + "$ref": "#/parameters/Azure.Core.TopQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.SkipQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.MaxPageSizeQueryParameter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedListImageIncidentSampleResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/image/incidents/{incidentName}/incidentSamples/{incidentSampleId}": { + "get": { + "operationId": "ImageIncidents_GetIncidentSample", + "summary": "Get ImageIncidentSample By imageIncidentName And imageIncidentSampleId", + "description": "Get imageIncidentSample by imageIncidentName and imageIncidentSampleId from a image incident.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "incidentName", + "in": "path", + "description": "incident name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + }, + { + "name": "incidentSampleId", + "in": "path", + "description": "incident name.", + "required": true, + "type": "string", + "maxLength": 64 + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/ImageIncidentSampleResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/image:analyze": { + "post": { + "operationId": "ImageOperations_AnalyzeImage", + "summary": "Analyze Image", + "description": "A synchronous API for the analysis of potentially harmful image content. Currently, it supports four categories: Hate, SelfHarm, Sexual, and Violence.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "body", + "in": "body", + "description": "The image analysis request.", + "required": true, + "schema": { + "$ref": "#/definitions/AnalyzeImageOptions" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/AnalyzeImageResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Analyze Image": { + "$ref": "./examples/AnalyzeImage.json" + } + } + } + }, + "/imageWithText:analyze": { + "post": { + "operationId": "ImageWithTextOperations_AnalyzeImageWithText", + "summary": "Analyze Image With Text", + "description": "A synchronous API for the analysis of potentially harmful image with text content. Currently, it supports four categories: Hate, SelfHarm, Sexual, and Violence.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "body", + "in": "body", + "description": "The image with text analysis request.", + "required": true, + "schema": { + "$ref": "#/definitions/AnalyzeImageWithTextOptions" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/AnalyzeImageWithTextResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/text/blocklists": { + "get": { + "operationId": "TextBlocklists_ListTextBlocklists", + "summary": "Get All Text Blocklists", + "description": "Get all text blocklists details.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedTextBlocklist" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Get All Text Blocklists": { + "$ref": "./examples/ListTextBlocklists.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/text/blocklists/{blocklistName}": { + "get": { + "operationId": "TextBlocklists_GetTextBlocklist", + "summary": "Get Text Blocklist By blocklistName", + "description": "Returns text blocklist details.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "blocklistName", + "in": "path", + "description": "Text blocklist name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/TextBlocklist" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Get Text Blocklist By blocklistName": { + "$ref": "./examples/GetTextBlocklist.json" + } + } + }, + "patch": { + "operationId": "TextBlocklists_CreateOrUpdateTextBlocklist", + "summary": "Create Or Update Text Blocklist", + "description": "Updates a text blocklist. If the blocklistName does not exist, a new blocklist will be created.", + "consumes": [ + "application/merge-patch+json" + ], + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "blocklistName", + "in": "path", + "description": "Text blocklist name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + }, + { + "name": "resource", + "in": "body", + "description": "The resource instance.", + "required": true, + "schema": { + "$ref": "#/definitions/TextBlocklistCreateOrUpdate" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/TextBlocklist" + } + }, + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "schema": { + "$ref": "#/definitions/TextBlocklist" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Create Or Update Text Blocklist": { + "$ref": "./examples/CreateOrUpdateTextBlocklist.json" + } + } + }, + "delete": { + "operationId": "TextBlocklists_DeleteTextBlocklist", + "summary": "Delete Text Blocklist By blocklistName", + "description": "Deletes a text blocklist.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "blocklistName", + "in": "path", + "description": "Text blocklist name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful. " + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Delete Text Blocklist By blocklistName": { + "$ref": "./examples/DeleteTextBlocklist.json" + } + } + } + }, + "/text/blocklists/{blocklistName}:addOrUpdateBlocklistItems": { + "post": { + "operationId": "TextBlocklists_AddOrUpdateBlocklistItems", + "summary": "Add or update BlocklistItems To Text Blocklist", + "description": "Add or update blocklistItems to a text blocklist. You can add or update at most 100 blocklistItems in one request.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "blocklistName", + "in": "path", + "description": "Text blocklist name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + }, + { + "name": "body", + "in": "body", + "description": "Options for adding or updating blocklist items.", + "required": true, + "schema": { + "$ref": "#/definitions/AddOrUpdateTextBlocklistItemsOptions" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/AddOrUpdateTextBlocklistItemsResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Add or Update BlocklistItems To Text Blocklist": { + "$ref": "./examples/AddOrUpdateBlocklistItems.json" + } + } + } + }, + "/text/blocklists/{blocklistName}:removeBlocklistItems": { + "post": { + "operationId": "TextBlocklists_RemoveBlocklistItems", + "summary": "Remove BlocklistItems From Text Blocklist", + "description": "Remove blocklistItems from a text blocklist. You can remove at most 100 BlocklistItems in one request.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "blocklistName", + "in": "path", + "description": "Text blocklist name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + }, + { + "name": "body", + "in": "body", + "description": "Options for removing blocklist items.", + "required": true, + "schema": { + "$ref": "#/definitions/RemoveTextBlocklistItemsOptions" + } + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful. " + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Remove BlockItems From Text Blocklist": { + "$ref": "./examples/RemoveBlocklistItems.json" + } + } + } + }, + "/text/blocklists/{blocklistName}/blocklistItems": { + "get": { + "operationId": "TextBlocklists_ListTextBlocklistItems", + "summary": "Get All BlocklistItems By blocklistName", + "description": "Get all blocklistItems in a text blocklist.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "blocklistName", + "in": "path", + "description": "Text blocklist name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + }, + { + "$ref": "#/parameters/Azure.Core.TopQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.SkipQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.MaxPageSizeQueryParameter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedTextBlocklistItem" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Get All BlockItems By blocklistName": { + "$ref": "./examples/ListTextBlocklistItems.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/text/blocklists/{blocklistName}/blocklistItems/{blocklistItemId}": { + "get": { + "operationId": "TextBlocklists_GetTextBlocklistItem", + "summary": "Get BlocklistItem By blocklistName And blocklistItemId", + "description": "Get blocklistItem by blocklistName and blocklistItemId from a text blocklist.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "blocklistName", + "in": "path", + "description": "Text blocklist name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + }, + { + "name": "blocklistItemId", + "in": "path", + "description": "The service will generate a BlocklistItemId, which will be a UUID.", + "required": true, + "type": "string", + "maxLength": 64 + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/TextBlocklistItem" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Get BlockItem By blocklistName And blocklistItemId": { + "$ref": "./examples/GetTextBlocklistItem.json" + } + } + } + }, + "/text/categories": { + "get": { + "operationId": "TextCategoryCustomization_ListTextCustomizedCategory", + "description": "Resource list operation template.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "$ref": "#/parameters/Azure.Core.TopQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.SkipQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.MaxPageSizeQueryParameter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedTextCustomizedCategory" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/text/categories/{categoryName}": { + "get": { + "operationId": "TextCategoryCustomization_GetTextCustomizedCategory", + "description": "Resource read operation template.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "categoryName", + "in": "path", + "description": "Text customizedCategories name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^Customized_[0-9A-Za-z._~-]+$" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/TextCustomizedCategory" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + }, + "put": { + "operationId": "TextCategoryCustomization_CreateOrReplaceTextCustomizedCategory", + "description": "Create or replace operation template.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "categoryName", + "in": "path", + "description": "Text customizedCategories name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^Customized_[0-9A-Za-z._~-]+$" + }, + { + "name": "resource", + "in": "body", + "description": "The resource instance.", + "required": true, + "schema": { + "$ref": "#/definitions/TextCustomizedCategory" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/TextCustomizedCategory" + } + }, + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "schema": { + "$ref": "#/definitions/TextCustomizedCategory" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + }, + "delete": { + "operationId": "TextCategoryCustomization_DeleteTextCustomizedCategory", + "description": "Resource delete operation template.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "categoryName", + "in": "path", + "description": "Text customizedCategories name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^Customized_[0-9A-Za-z._~-]+$" + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful. " + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/text/incidents": { + "get": { + "operationId": "TextIncidents_ListIncidents", + "summary": "Get All Text Incidents", + "description": "Get all incidents details.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "$ref": "#/parameters/Azure.Core.TopQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.SkipQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.MaxPageSizeQueryParameter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedTextIncident" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/text/incidents/{incidentName}": { + "get": { + "operationId": "TextIncidents_GetIncidents", + "summary": "Get Text Incident By incidentName", + "description": "Returns text incident details.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "incidentName", + "in": "path", + "description": "incident name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/TextIncident" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + }, + "patch": { + "operationId": "TextIncidents_CreateOrUpdateIncident", + "summary": "Create Or Update Text Incident", + "description": "Updates a text incident. If the text incident does not exist, a new text incident will be created.", + "consumes": [ + "application/merge-patch+json" + ], + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "incidentName", + "in": "path", + "description": "incident name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + }, + { + "name": "resource", + "in": "body", + "description": "The resource instance.", + "required": true, + "schema": { + "$ref": "#/definitions/TextIncidentCreateOrUpdate" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/TextIncident" + } + }, + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "schema": { + "$ref": "#/definitions/TextIncident" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + }, + "delete": { + "operationId": "TextIncidents_DeleteIncident", + "summary": "Delete Text Incident By incidentName", + "description": "Deletes a text incident.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "incidentName", + "in": "path", + "description": "incident name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful. " + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/text/incidents/{incidentName}:addIncidentSamples": { + "post": { + "operationId": "TextIncidents_AddIncidentSamples", + "summary": "Add TextIncidentSamples To Incident", + "description": "Add textIncidentSamples to an incident. You can add at most 100 textIncidentSamples in one request.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "incidentName", + "in": "path", + "description": "incident name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AddTextIncidentSamplesOptions" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/AddTextIncidentSamplesResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/text/incidents/{incidentName}:removeIncidentSamples": { + "post": { + "operationId": "TextIncidents_RemoveIncidentSamples", + "summary": "Remove TextIncidentSamples From Incident", + "description": "Remove textIncidentSamples from an incident. You can remove at most 100 Text Incident in one request.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "incidentName", + "in": "path", + "description": "incident name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RemoveTextIncidentSamplesOptions" + } + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful. " + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/text/incidents/{incidentName}/incidentSamples": { + "get": { + "operationId": "TextIncidents_ListIncidentSamples", + "summary": "Get All TextIncidentSamples By textIncidentName", + "description": "Get all TextIncidentSamples in a text incident.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "incidentName", + "in": "path", + "description": "incident name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + }, + { + "$ref": "#/parameters/Azure.Core.TopQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.SkipQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.MaxPageSizeQueryParameter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedTextIncidentSample" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/text/incidents/{incidentName}/incidentSamples/{incidentSampleId}": { + "get": { + "operationId": "TextIncidents_GetIncidentSample", + "summary": "Get TextIncidentSample By textIncidentName And textIncidentSampleId", + "description": "Get textIncidentSample by textIncidentName and textIncidentSampleId from a text incident.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "incidentName", + "in": "path", + "description": "incident name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + }, + { + "name": "incidentSampleId", + "in": "path", + "description": "incident name.", + "required": true, + "type": "string", + "maxLength": 64 + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/TextIncidentSample" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/text:adaptiveAnnotate": { + "post": { + "operationId": "PromptTextOperations_AnnotateText", + "summary": "Annotate Text by Prompt", + "description": "A remote procedure call (RPC) operation.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "body", + "in": "body", + "description": "The text analysis request.", + "required": true, + "schema": { + "$ref": "#/definitions/AnnotateTextOptions" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/AnnotateTextResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/text:analyze": { + "post": { + "operationId": "TextOperations_AnalyzeText", + "summary": "Analyze Text", + "description": "A synchronous API for the analysis of potentially harmful text content. Currently, it supports four categories: Hate, SelfHarm, Sexual, and Violence.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "body", + "in": "body", + "description": "The text analysis request.", + "required": true, + "schema": { + "$ref": "#/definitions/AnalyzeTextOptions" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/AnalyzeTextResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Analyze Text": { + "$ref": "./examples/AnalyzeText.json" + } + } + } + }, + "/text:detectJailbreak": { + "post": { + "operationId": "TextOperations_DetectTextJailbreak", + "summary": "Analyze Text Jailbreak", + "description": "A synchronous API for the analysis of text jailbreak.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "body", + "in": "body", + "description": "The text jailbreak analysis request.", + "required": true, + "schema": { + "$ref": "#/definitions/AnalyzeTextJailbreakOptions" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/AnalyzeTextJailbreakResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/text:detectProtectedMaterial": { + "post": { + "operationId": "TextOperations_DetectTextProtectedMaterial", + "summary": "Analyze Protected Material", + "description": "A synchronous API for the analysis of protected material.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "body", + "in": "body", + "description": "The text protected material analysis request.", + "required": true, + "schema": { + "$ref": "#/definitions/AnalyzeTextProtectedMaterialOptions" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/AnalyzeTextProtectedMaterialResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/text:detectUngroundedness": { + "post": { + "operationId": "TextUngroundednessDetectionOperations_DetectUngroundedness", + "summary": "Detect Ungrounded Information", + "description": "A synchronous API for the analysis of language model outputs to determine alignment with user-provided information or identify fictional content.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "body", + "in": "body", + "description": "The ungroundedness detection request.", + "required": true, + "schema": { + "$ref": "#/definitions/DetectUngroundednessOptions" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/DetectUngroundednessResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + } + }, + "definitions": { + "AddImageIncidentSamplesOptions": { + "type": "object", + "description": "The request to add incidentSamples to a incident.", + "properties": { + "incidentSamples": { + "type": "array", + "description": "Array of incidentSamples to add.", + "items": { + "$ref": "#/definitions/ImageIncidentSample" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "incidentSamples" + ] + }, + "AddImageIncidentSamplesResult": { + "type": "object", + "description": "The response of adding incidentSamples to the incident.", + "properties": { + "incidentSamples": { + "type": "array", + "description": "Array of incidentSamples have been added.", + "items": { + "$ref": "#/definitions/ListImageIncidentSampleResult" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "incidentSamples" + ] + }, + "AddOrUpdateTextBlocklistItemsOptions": { + "type": "object", + "description": "The request to add blocklistItems to a text blocklist.", + "properties": { + "blocklistItems": { + "type": "array", + "description": "Array of blocklistItems to add.", + "items": { + "$ref": "#/definitions/TextBlocklistItem" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "blocklistItems" + ] + }, + "AddOrUpdateTextBlocklistItemsResult": { + "type": "object", + "description": "The response of adding blocklistItems to the text blocklist.", + "properties": { + "blocklistItems": { + "type": "array", + "description": "Array of blocklistItems have been added.", + "items": { + "$ref": "#/definitions/TextBlocklistItem" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "blocklistItems" + ] + }, + "AddTextIncidentSamplesOptions": { + "type": "object", + "description": "The request to add incidentSamples to a incident.", + "properties": { + "incidentSamples": { + "type": "array", + "description": "Array of incidentSamples to add.", + "items": { + "$ref": "#/definitions/TextIncidentSample" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "incidentSamples" + ] + }, + "AddTextIncidentSamplesResult": { + "type": "object", + "description": "The response of adding incidentSamples to the incident.", + "properties": { + "incidentSamples": { + "type": "array", + "description": "Array of incidentSamples have been added.", + "items": { + "$ref": "#/definitions/TextIncidentSample" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "incidentSamples" + ] + }, + "AnalyzeImageOptions": { + "type": "object", + "description": "The image analysis request.", + "properties": { + "image": { + "$ref": "#/definitions/ImageData", + "description": "The image needs to be analyzed." + }, + "categories": { + "type": "array", + "description": "The categories will be analyzed. If they are not assigned, a default set of analysis results for the categories will be returned.", + "items": { + "$ref": "#/definitions/ImageCategory" + } + }, + "outputType": { + "$ref": "#/definitions/AnalyzeImageOutputType", + "description": "This refers to the type of image analysis output. If no value is assigned, the default value will be \"FourSeverityLevels\".", + "default": "FourSeverityLevels" + }, + "incidents": { + "$ref": "#/definitions/IncidentOptions", + "description": "The incidents to detect." + } + }, + "required": [ + "image" + ] + }, + "AnalyzeImageOutputType": { + "type": "string", + "description": "The type of image analysis output.", + "enum": [ + "FourSeverityLevels" + ], + "x-ms-enum": { + "name": "AnalyzeImageOutputType", + "modelAsString": true, + "values": [ + { + "name": "FourSeverityLevels", + "value": "FourSeverityLevels", + "description": "Output severities in four levels, the value could be 0,2,4,6." + } + ] + } + }, + "AnalyzeImageResult": { + "type": "object", + "description": "The image analysis response.", + "properties": { + "categoriesAnalysis": { + "type": "array", + "description": "Analysis result for categories.", + "items": { + "$ref": "#/definitions/ImageCategoriesAnalysis" + }, + "x-ms-identifiers": [] + }, + "incidentMatches": { + "type": "array", + "description": "The incident match details.", + "items": { + "$ref": "#/definitions/IncidentMatch" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "categoriesAnalysis" + ] + }, + "AnalyzeImageWithTextOptions": { + "type": "object", + "description": "The analysis request of the image with text.", + "properties": { + "image": { + "$ref": "#/definitions/ImageData", + "description": "The image needs to be analyzed." + }, + "text": { + "type": "string", + "description": "The text attached to the image. We support at most 1k characters (unicode code points) in one text request.", + "maxLength": 1000 + }, + "categories": { + "type": "array", + "description": "The categories will be analyzed. If they are not assigned, a default set of analysis results for the categories will be returned.", + "items": { + "$ref": "#/definitions/ImageWithTextCategory" + } + }, + "enableOcr": { + "type": "boolean", + "description": "When set to true, our service will perform OCR and concatenate the recognized text with input text before analyzing. We will recognize at most 256 characters (unicode code points) from input image. The others will be truncated." + } + }, + "required": [ + "image", + "enableOcr" + ] + }, + "AnalyzeImageWithTextResult": { + "type": "object", + "description": "The analysis response of the image with text.", + "properties": { + "categoriesAnalysis": { + "type": "array", + "description": "Analysis result for categories.", + "items": { + "$ref": "#/definitions/ImageWithTextCategoriesAnalysis" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "categoriesAnalysis" + ] + }, + "AnalyzeTextJailbreakOptions": { + "type": "object", + "description": "The text jailbreak analysis request.", + "properties": { + "text": { + "type": "string", + "description": "The text needs to be analyzed if it attempt to jailbreak. We support a maximum of 1k Unicode characters (Unicode code points) in the text of one request.", + "maxLength": 1000 + } + }, + "required": [ + "text" + ] + }, + "AnalyzeTextJailbreakResult": { + "type": "object", + "description": "The text jailbreak analysis request.", + "properties": { + "jailbreakAnalysis": { + "$ref": "#/definitions/JailbreakAnalysisResult", + "description": "Analysis result for jailbreak." + } + }, + "required": [ + "jailbreakAnalysis" + ] + }, + "AnalyzeTextOptions": { + "type": "object", + "description": "The text analysis request.", + "properties": { + "text": { + "type": "string", + "description": "The text needs to be analyzed. We support a maximum of 10k Unicode characters (Unicode code points) in the text of one request.", + "maxLength": 10000 + }, + "categories": { + "type": "array", + "description": "The categories will be analyzed. If they are not assigned, a default set of analysis results for the categories will be returned.", + "items": { + "$ref": "#/definitions/TextCategory" + } + }, + "blocklistNames": { + "type": "array", + "description": "The names of blocklists.", + "items": { + "type": "string" + } + }, + "haltOnBlocklistHit": { + "type": "boolean", + "description": "When set to true, further analyses of harmful content will not be performed in cases where blocklists are hit. When set to false, all analyses of harmful content will be performed, whether or not blocklists are hit." + }, + "outputType": { + "$ref": "#/definitions/AnalyzeTextOutputType", + "description": "This refers to the type of text analysis output. If no value is assigned, the default value will be \"FourSeverityLevels\".", + "default": "FourSeverityLevels" + }, + "incidents": { + "$ref": "#/definitions/IncidentOptions", + "description": "The incidents to detect." + } + }, + "required": [ + "text" + ] + }, + "AnalyzeTextOutputType": { + "type": "string", + "description": "The type of text analysis output.", + "enum": [ + "FourSeverityLevels", + "EightSeverityLevels" + ], + "x-ms-enum": { + "name": "AnalyzeTextOutputType", + "modelAsString": true, + "values": [ + { + "name": "FourSeverityLevels", + "value": "FourSeverityLevels", + "description": "Output severities in four levels, the value could be 0,2,4,6." + }, + { + "name": "EightSeverityLevels", + "value": "EightSeverityLevels", + "description": "Output severities in eight levels, the value could be 0,1,2,3,4,5,6,7." + } + ] + } + }, + "AnalyzeTextProtectedMaterialOptions": { + "type": "object", + "description": "The protected material analysis request.", + "properties": { + "text": { + "type": "string", + "description": "The text needs to be analyzed. We support a maximum of 1k Unicode characters (Unicode code points) in the text of one request.", + "maxLength": 1000 + } + }, + "required": [ + "text" + ] + }, + "AnalyzeTextProtectedMaterialResult": { + "type": "object", + "description": "The protected material analysis response.", + "properties": { + "protectedMaterialAnalysis": { + "$ref": "#/definitions/ProtectedMaterialAnalysisResult", + "description": "Analysis result for protected material." + } + }, + "required": [ + "protectedMaterialAnalysis" + ] + }, + "AnalyzeTextResult": { + "type": "object", + "description": "The text analysis response.", + "properties": { + "blocklistsMatch": { + "type": "array", + "description": "The blocklist match details.", + "items": { + "$ref": "#/definitions/TextBlocklistMatch" + }, + "x-ms-identifiers": [] + }, + "categoriesAnalysis": { + "type": "array", + "description": "Analysis result for categories.", + "items": { + "$ref": "#/definitions/TextCategoriesAnalysis" + }, + "x-ms-identifiers": [] + }, + "incidentMatches": { + "type": "array", + "description": "The incident match details.", + "items": { + "$ref": "#/definitions/IncidentMatch" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "categoriesAnalysis" + ] + }, + "AnnotateTextOptions": { + "type": "object", + "description": "Annotate text options", + "properties": { + "text": { + "type": "string", + "description": "The text needs to be analyzed. We support a maximum of 10k Unicode characters (Unicode code points) in the text of one request.", + "maxLength": 10000 + }, + "category": { + "type": "string", + "description": "The category will be analyzed, you can set your customized category or one of built-in categories in 'Hate','Selfharm', 'Sexual' and 'Violence'." + } + }, + "required": [ + "text", + "category" + ] + }, + "AnnotateTextResult": { + "type": "object", + "description": "The text annotation response.", + "properties": { + "id": { + "type": "integer", + "format": "int32", + "description": "The id of annotated subcategory." + }, + "name": { + "type": "string", + "description": "The name of annotated subcategory." + }, + "reasoning": { + "type": "string", + "description": "The reasoning." + } + }, + "required": [ + "id", + "name" + ] + }, + "Azure.Core.Foundations.Error": { + "type": "object", + "description": "The error object.", + "properties": { + "code": { + "type": "string", + "description": "One of a server-defined set of error codes." + }, + "message": { + "type": "string", + "description": "A human-readable representation of the error." + }, + "target": { + "type": "string", + "description": "The target of the error." + }, + "details": { + "type": "array", + "description": "An array of details about specific errors that led to this reported error.", + "items": { + "$ref": "#/definitions/Azure.Core.Foundations.Error" + }, + "x-ms-identifiers": [] + }, + "innererror": { + "$ref": "#/definitions/Azure.Core.Foundations.InnerError", + "description": "An object containing more specific information than the current object about the error." + } + }, + "required": [ + "code", + "message" + ] + }, + "Azure.Core.Foundations.ErrorResponse": { + "type": "object", + "description": "A response containing error details.", + "properties": { + "error": { + "$ref": "#/definitions/Azure.Core.Foundations.Error", + "description": "The error object." + } + }, + "required": [ + "error" + ] + }, + "Azure.Core.Foundations.InnerError": { + "type": "object", + "description": "An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.", + "properties": { + "code": { + "type": "string", + "description": "One of a server-defined set of error codes." + }, + "innererror": { + "$ref": "#/definitions/Azure.Core.Foundations.InnerError", + "description": "Inner error." + } + } + }, + "DetectUngroundednessOptions": { + "type": "object", + "description": "The request of ungroundedness detection.", + "properties": { + "domain": { + "$ref": "#/definitions/Domain", + "description": "The domain of the text for analysis.\nThis field is optional, with a default value of Generic." + }, + "task": { + "$ref": "#/definitions/Task", + "description": "The task type for the text analysis.\nThis field is optional, with a default value of Summarization." + }, + "query": { + "type": "string", + "description": "The user's question input in a QnA scenario.\nThis field is optional, but if the task type is set to QnA, it becomes required." + }, + "text": { + "type": "string", + "description": "The text requiring analysis." + }, + "groundingSources": { + "type": "array", + "description": "The source information used as a grounding reference.", + "items": { + "type": "string" + } + }, + "reasoning": { + "type": "boolean", + "description": "A value indicating if the output includes an explanation for the identified ungroundedness.\nThis field is optional, with a default value of false." + }, + "gptResource": { + "$ref": "#/definitions/GptResource", + "description": "Connection details for the GPT resource. \nThis field will be used only when the 'reasoning' field is set to true; otherwise, it will be ignored." + } + }, + "required": [ + "text", + "groundingSources" + ] + }, + "DetectUngroundednessResult": { + "type": "object", + "description": "The response of ungroundedness detection.", + "properties": { + "ungrounded": { + "type": "boolean", + "description": "Detection result for ungrounded text." + }, + "confidenceScore": { + "type": "number", + "format": "float", + "description": "Confidence score of the model in the analysis results." + }, + "ungroundedPercentage": { + "type": "number", + "format": "float", + "description": "Percentage of ungrounded Text." + }, + "ungroundedDetails": { + "type": "array", + "description": "The detailed information about a text identified as ungrounded.", + "items": { + "$ref": "#/definitions/UngroundedDetails" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "ungrounded", + "confidenceScore", + "ungroundedPercentage", + "ungroundedDetails" + ] + }, + "Domain": { + "type": "string", + "description": "Domain.", + "enum": [ + "Generic", + "Medical" + ], + "x-ms-enum": { + "name": "Domain", + "modelAsString": true + } + }, + "GptResource": { + "type": "object", + "description": "Connection details for the GPT resource.", + "properties": { + "azureOpenAIEndpoint": { + "type": "string", + "description": "Endpoint for Azure OpenAI resource." + }, + "deploymentName": { + "type": "string", + "description": "Deployment model name." + } + }, + "required": [ + "azureOpenAIEndpoint", + "deploymentName" + ] + }, + "ImageCategoriesAnalysis": { + "type": "object", + "description": "Image analysis result.", + "properties": { + "category": { + "$ref": "#/definitions/ImageCategory", + "description": "The image analysis category." + }, + "severity": { + "type": "integer", + "format": "int32", + "description": "The value increases with the severity of the input content. The value of this field is determined by the output type specified in the request. The output type could be ‘FourSeverityLevels’, and the output value can be 0, 2, 4, 6." + } + }, + "required": [ + "category" + ] + }, + "ImageCategory": { + "type": "string", + "description": "Image analyze category.", + "enum": [ + "Hate", + "SelfHarm", + "Sexual", + "Violence" + ], + "x-ms-enum": { + "name": "ImageCategory", + "modelAsString": true + } + }, + "ImageData": { + "type": "object", + "description": "The image can be either base64 encoded bytes or a blob URL. You can choose only one of these options. If both are provided, the request will be refused. The maximum image size is 2048 x 2048 pixels and should not exceed 4 MB, while the minimum image size is 50 x 50 pixels.", + "properties": { + "content": { + "type": "string", + "format": "byte", + "description": "The Base64 encoding of the image." + }, + "blobUrl": { + "type": "string", + "format": "uri", + "description": "The blob url of the image." + } + } + }, + "ImageDataResult": { + "type": "object", + "description": "The image result is base64 encoded bytes", + "properties": { + "content": { + "type": "string", + "format": "byte", + "description": "The Base64 encoding of the image." + } + } + }, + "ImageIncident": { + "type": "object", + "description": "Image Incident.", + "properties": { + "incidentName": { + "type": "string", + "description": "incident name.", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$", + "x-ms-mutability": [ + "read", + "create" + ] + }, + "description": { + "type": "string", + "description": "Incident description.", + "maxLength": 1024 + }, + "created": { + "type": "string", + "format": "date-time", + "description": "Incident created time.", + "x-ms-mutability": [ + "read" + ] + }, + "lastUpdated": { + "type": "string", + "format": "date-time", + "description": "Incident updated time.", + "x-ms-mutability": [ + "read" + ] + } + }, + "required": [ + "incidentName", + "created", + "lastUpdated" + ] + }, + "ImageIncidentCreateOrUpdate": { + "type": "object", + "description": "Image Incident.", + "properties": { + "incidentName": { + "type": "string", + "description": "incident name.", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$", + "x-ms-mutability": [ + "read", + "create" + ] + }, + "description": { + "type": "string", + "description": "Incident description.", + "maxLength": 1024 + } + } + }, + "ImageIncidentSample": { + "type": "object", + "description": "Sample in an Image Incident.", + "properties": { + "incidentSampleId": { + "type": "string", + "description": "incident name.", + "maxLength": 64, + "readOnly": true + }, + "image": { + "$ref": "#/definitions/ImageData", + "description": "IncidentSample image content." + } + }, + "required": [ + "incidentSampleId" + ] + }, + "ImageIncidentSampleResult": { + "type": "object", + "description": "Sample Result in an Image Incident.", + "properties": { + "incidentSampleId": { + "type": "string", + "description": "incident name.", + "maxLength": 64, + "readOnly": true + }, + "image": { + "$ref": "#/definitions/ImageDataResult", + "description": "IncidentSample image content." + } + }, + "required": [ + "incidentSampleId" + ] + }, + "ImageWithTextCategoriesAnalysis": { + "type": "object", + "description": "ImageWithText analysis result.", + "properties": { + "category": { + "$ref": "#/definitions/ImageWithTextCategory", + "description": "The imageWithtext analysis category." + }, + "severity": { + "type": "integer", + "format": "int32", + "description": "The higher the severity of input content, the larger this value is. The values could be: 0,2,4,6." + } + }, + "required": [ + "category" + ] + }, + "ImageWithTextCategory": { + "type": "string", + "description": "ImageWithText analyze category.", + "enum": [ + "Hate", + "SelfHarm", + "Sexual", + "Violence" + ], + "x-ms-enum": { + "name": "ImageWithTextCategory", + "modelAsString": true + } + }, + "IncidentMatch": { + "type": "object", + "description": "The result of text incident match.", + "properties": { + "incidentName": { + "type": "string", + "description": "The name of the matched incident.", + "maxLength": 64 + } + }, + "required": [ + "incidentName" + ] + }, + "IncidentOptions": { + "type": "object", + "description": "The text analysis request.", + "properties": { + "incidentNames": { + "type": "array", + "description": "The accept decision made by service.", + "items": { + "type": "string" + } + }, + "haltOnIncidentHit": { + "type": "boolean", + "description": "When set to true, further analyses of harmful content will not be performed in cases where incidents are hit. When set to false, all analyses of harmful content will be performed, whether or not incidents are hit." + } + } + }, + "JailbreakAnalysisResult": { + "type": "object", + "description": "The text jailbreak analysis response.", + "properties": { + "detected": { + "type": "boolean", + "description": "Analysis result for jailbreak." + } + }, + "required": [ + "detected" + ] + }, + "ListImageIncidentSampleResult": { + "type": "object", + "description": "Sample in a Image Incident.", + "properties": { + "incidentSampleId": { + "type": "string", + "description": "incident name.", + "maxLength": 64, + "readOnly": true + } + }, + "required": [ + "incidentSampleId" + ] + }, + "PagedImageIncident": { + "type": "object", + "description": "Paged collection of ImageIncident items", + "properties": { + "value": { + "type": "array", + "description": "The ImageIncident items on this page", + "items": { + "$ref": "#/definitions/ImageIncident" + }, + "x-ms-identifiers": [] + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "PagedListImageIncidentSampleResult": { + "type": "object", + "description": "Paged collection of ListImageIncidentSampleResult items", + "properties": { + "value": { + "type": "array", + "description": "The ListImageIncidentSampleResult items on this page", + "items": { + "$ref": "#/definitions/ListImageIncidentSampleResult" + }, + "x-ms-identifiers": [] + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "PagedTextBlocklist": { + "type": "object", + "description": "Paged collection of TextBlocklist items", + "properties": { + "value": { + "type": "array", + "description": "The TextBlocklist items on this page", + "items": { + "$ref": "#/definitions/TextBlocklist" + }, + "x-ms-identifiers": [] + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "PagedTextBlocklistItem": { + "type": "object", + "description": "Paged collection of TextBlocklistItem items", + "properties": { + "value": { + "type": "array", + "description": "The TextBlocklistItem items on this page", + "items": { + "$ref": "#/definitions/TextBlocklistItem" + }, + "x-ms-identifiers": [] + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "PagedTextCustomizedCategory": { + "type": "object", + "description": "Paged collection of TextCustomizedCategory items", + "properties": { + "value": { + "type": "array", + "description": "The TextCustomizedCategory items on this page", + "items": { + "$ref": "#/definitions/TextCustomizedCategory" + }, + "x-ms-identifiers": [] + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "PagedTextIncident": { + "type": "object", + "description": "Paged collection of TextIncident items", + "properties": { + "value": { + "type": "array", + "description": "The TextIncident items on this page", + "items": { + "$ref": "#/definitions/TextIncident" + }, + "x-ms-identifiers": [] + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "PagedTextIncidentSample": { + "type": "object", + "description": "Paged collection of TextIncidentSample items", + "properties": { + "value": { + "type": "array", + "description": "The TextIncidentSample items on this page", + "items": { + "$ref": "#/definitions/TextIncidentSample" + }, + "x-ms-identifiers": [] + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "PreDefinedConcept": { + "type": "object", + "description": "Pre-defined concept.", + "properties": { + "concept": { + "type": "string" + }, + "description": { + "type": "string" + } + }, + "required": [ + "concept", + "description" + ] + }, + "ProtectedMaterialAnalysisResult": { + "type": "object", + "description": "The text protected material analysis response.", + "properties": { + "detected": { + "type": "boolean", + "description": "Analysis result for protected material.." + } + }, + "required": [ + "detected" + ] + }, + "RemoveImageIncidentSamplesOptions": { + "type": "object", + "description": "The request to remove incidentSamples from a incident.", + "properties": { + "incidentSampleIds": { + "type": "array", + "description": "Array of incidentSamples to remove.", + "items": { + "type": "string" + } + } + }, + "required": [ + "incidentSampleIds" + ] + }, + "RemoveTextBlocklistItemsOptions": { + "type": "object", + "description": "The request to remove blocklistItems from a text blocklist.", + "properties": { + "blocklistItemIds": { + "type": "array", + "description": "Array of blocklistItemIds to remove.", + "items": { + "type": "string" + } + } + }, + "required": [ + "blocklistItemIds" + ] + }, + "RemoveTextIncidentSamplesOptions": { + "type": "object", + "description": "The request to remove incidentSamples from a incident.", + "properties": { + "incidentSampleIds": { + "type": "array", + "description": "Array of incidentSamples to remove.", + "items": { + "type": "string" + } + } + }, + "required": [ + "incidentSampleIds" + ] + }, + "SubCategory": { + "type": "object", + "description": "Label definition.", + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "name": { + "type": "string" + }, + "statements": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "id", + "name", + "statements" + ] + }, + "Task": { + "type": "string", + "description": "Task type.", + "enum": [ + "Summarization", + "QnA" + ], + "x-ms-enum": { + "name": "Task", + "modelAsString": true + } + }, + "TextBlocklist": { + "type": "object", + "description": "Text Blocklist.", + "properties": { + "blocklistName": { + "type": "string", + "description": "Text blocklist name.", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$", + "x-ms-mutability": [ + "read", + "create" + ] + }, + "description": { + "type": "string", + "description": "Text blocklist description.", + "maxLength": 1024 + } + }, + "required": [ + "blocklistName" + ] + }, + "TextBlocklistCreateOrUpdate": { + "type": "object", + "description": "Text Blocklist.", + "properties": { + "blocklistName": { + "type": "string", + "description": "Text blocklist name.", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$", + "x-ms-mutability": [ + "read", + "create" + ] + }, + "description": { + "type": "string", + "description": "Text blocklist description.", + "maxLength": 1024 + } + } + }, + "TextBlocklistItem": { + "type": "object", + "description": "Item in a TextBlocklist.", + "properties": { + "blocklistItemId": { + "type": "string", + "description": "The service will generate a BlocklistItemId, which will be a UUID.", + "maxLength": 64, + "readOnly": true + }, + "description": { + "type": "string", + "description": "BlocklistItem description.", + "maxLength": 1024 + }, + "text": { + "type": "string", + "description": "BlocklistItem content.", + "maxLength": 128 + } + }, + "required": [ + "blocklistItemId", + "text" + ] + }, + "TextBlocklistMatch": { + "type": "object", + "description": "The result of blocklist match.", + "properties": { + "blocklistName": { + "type": "string", + "description": "The name of the matched blocklist.", + "maxLength": 64 + }, + "blocklistItemId": { + "type": "string", + "description": "The ID of the matched item.", + "maxLength": 64 + }, + "blocklistItemText": { + "type": "string", + "description": "The content of the matched item.", + "maxLength": 128 + } + }, + "required": [ + "blocklistName", + "blocklistItemId", + "blocklistItemText" + ] + }, + "TextCategoriesAnalysis": { + "type": "object", + "description": "Text analysis result.", + "properties": { + "category": { + "$ref": "#/definitions/TextCategory", + "description": "The text analysis category." + }, + "severity": { + "type": "integer", + "format": "int32", + "description": "The value increases with the severity of the input content. The value of this field is determined by the output type specified in the request. The output type could be ‘FourSeverityLevels’ or ‘EightSeverity Levels’, and the output value can be 0, 2, 4, 6 or 0, 1, 2, 3, 4, 5, 6, or 7." + } + }, + "required": [ + "category" + ] + }, + "TextCategory": { + "type": "string", + "description": "Text analyze category.", + "enum": [ + "Hate", + "SelfHarm", + "Sexual", + "Violence" + ], + "x-ms-enum": { + "name": "TextCategory", + "modelAsString": true + } + }, + "TextCustomizedCategory": { + "type": "object", + "description": "Text Customized categories.", + "properties": { + "categoryName": { + "type": "string", + "description": "Text customizedCategories name.", + "maxLength": 64, + "pattern": "^Customized_[0-9A-Za-z._~-]+$", + "x-ms-mutability": [ + "read", + "create" + ] + }, + "preDefinedConcepts": { + "type": "array", + "items": { + "$ref": "#/definitions/PreDefinedConcept" + }, + "x-ms-identifiers": [] + }, + "subCategories": { + "type": "array", + "items": { + "$ref": "#/definitions/SubCategory" + } + }, + "emphases": { + "type": "array", + "items": { + "type": "string" + } + }, + "exampleBlobUrl": { + "type": "string", + "format": "uri" + } + }, + "required": [ + "categoryName", + "subCategories" + ] + }, + "TextIncident": { + "type": "object", + "description": "Text Incident.", + "properties": { + "incidentName": { + "type": "string", + "description": "incident name.", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$", + "x-ms-mutability": [ + "read", + "create" + ] + }, + "description": { + "type": "string", + "description": "Incident description.", + "maxLength": 1024 + }, + "created": { + "type": "string", + "format": "date-time", + "description": "Incident created time.", + "x-ms-mutability": [ + "read" + ] + }, + "lastUpdated": { + "type": "string", + "format": "date-time", + "description": "Incident updated time.", + "x-ms-mutability": [ + "read" + ] + } + }, + "required": [ + "incidentName", + "created", + "lastUpdated" + ] + }, + "TextIncidentCreateOrUpdate": { + "type": "object", + "description": "Text Incident.", + "properties": { + "incidentName": { + "type": "string", + "description": "incident name.", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$", + "x-ms-mutability": [ + "read", + "create" + ] + }, + "description": { + "type": "string", + "description": "Incident description.", + "maxLength": 1024 + } + } + }, + "TextIncidentSample": { + "type": "object", + "description": "Sample in a Text Incident.", + "properties": { + "incidentSampleId": { + "type": "string", + "description": "incident name.", + "maxLength": 64, + "readOnly": true + }, + "text": { + "type": "string", + "description": "IncidentSample text content.", + "maxLength": 1024 + } + }, + "required": [ + "incidentSampleId" + ] + }, + "UngroundedDetails": { + "type": "object", + "description": "The detailed information about a text identified as ungrounded.", + "properties": { + "text": { + "type": "string", + "description": "The ungrounded text." + }, + "reason": { + "type": "string", + "description": "The explanation for identifying the text as ungrounded. \nOnly when the 'reasoning' field in the input is set to true 'reason' field will be returned." + } + }, + "required": [ + "text" + ] + } + }, + "parameters": { + "Azure.Core.Foundations.ApiVersionParameter": { + "name": "api-version", + "in": "query", + "description": "The API version to use for this operation.", + "required": true, + "type": "string", + "minLength": 1, + "x-ms-parameter-location": "method", + "x-ms-client-name": "apiVersion" + }, + "Azure.Core.MaxPageSizeQueryParameter": { + "name": "maxpagesize", + "in": "query", + "description": "The maximum number of result items per page.", + "required": false, + "type": "integer", + "format": "int32", + "x-ms-parameter-location": "method" + }, + "Azure.Core.SkipQueryParameter": { + "name": "skip", + "in": "query", + "description": "The number of result items to skip.", + "required": false, + "type": "integer", + "format": "int32", + "default": 0, + "x-ms-parameter-location": "method" + }, + "Azure.Core.TopQueryParameter": { + "name": "top", + "in": "query", + "description": "The number of result items to return.", + "required": false, + "type": "integer", + "format": "int32", + "x-ms-parameter-location": "method" + } + } +} diff --git a/specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/AddOrUpdateBlocklistItems.json b/specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/AddOrUpdateBlocklistItems.json new file mode 100644 index 000000000000..c7353595d2ef --- /dev/null +++ b/specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/AddOrUpdateBlocklistItems.json @@ -0,0 +1,30 @@ +{ + "title": "Add or Update BlocklistItems To Text Blocklist", + "operationId": "TextBlocklists_AddOrUpdateBlocklistItems", + "parameters": { + "api-version": "2023-12-30-preview", + "blocklistName": "TestBlocklist", + "body": { + "blocklistItems": [ + { + "blocklistItemId": null, + "description": "Hate word", + "text": "hate" + } + ] + } + }, + "responses": { + "200": { + "body": { + "blocklistItems": [ + { + "blocklistItemId": "9511969e-f1e3-4604-9127-05ee16c509ec", + "description": "Hate word", + "text": "hate" + } + ] + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/AnalyzeImage.json b/specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/AnalyzeImage.json new file mode 100644 index 000000000000..0d447cf2bab2 --- /dev/null +++ b/specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/AnalyzeImage.json @@ -0,0 +1,36 @@ +{ + "title": "Analyze Image", + "operationId": "ImageOperations_AnalyzeImage", + "parameters": { + "api-version": "2023-12-30-preview", + "body": { + "image": { + "content": "Y29udGVudDE=" + } + } + }, + "responses": { + "200": { + "body": { + "categoriesAnalysis": [ + { + "category": "Hate", + "severity": 0 + }, + { + "category": "SelfHarm", + "severity": 0 + }, + { + "category": "Sexual", + "severity": 0 + }, + { + "category": "Violence", + "severity": 2 + } + ] + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/AnalyzeText.json b/specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/AnalyzeText.json new file mode 100644 index 000000000000..c15ad6ccad29 --- /dev/null +++ b/specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/AnalyzeText.json @@ -0,0 +1,38 @@ +{ + "title": "Analyze Text", + "operationId": "TextOperations_AnalyzeText", + "parameters": { + "api-version": "2023-12-30-preview", + "body": { + "text": "This is text example. A hate speech sentence. A sentence with a violent description." + } + }, + "responses": { + "200": { + "body": { + "blocklistsMatch": [], + "categoriesAnalysis": [{ + "category": "Hate", + "severity": 0 + }, + { + "category": "SelfHarm", + "severity": 0 + }, + { + "category": "Sexual", + "severity": 0 + }, + { + "category": "Violence", + "severity": 0 + } + ], + "citation": [ + "A hate speech sentence", + "A sentence with a violent description" + ] + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/CreateOrUpdateTextBlocklist.json b/specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/CreateOrUpdateTextBlocklist.json new file mode 100644 index 000000000000..c8950fe923b6 --- /dev/null +++ b/specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/CreateOrUpdateTextBlocklist.json @@ -0,0 +1,25 @@ +{ + "title": "Create Or Update Text Blocklist", + "operationId": "TextBlocklists_CreateOrUpdateTextBlocklist", + "parameters": { + "api-version": "2023-12-30-preview", + "blocklistName": "TestBlocklist", + "resource": { + "description": "Test Blocklist" + } + }, + "responses": { + "200": { + "body": { + "blocklistName": "TestBlocklist", + "description": "Test Blocklist" + } + }, + "201": { + "body": { + "blocklistName": "TestBlocklist", + "description": "Test Blocklist" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/DeleteTextBlocklist.json b/specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/DeleteTextBlocklist.json new file mode 100644 index 000000000000..30af65c0662d --- /dev/null +++ b/specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/DeleteTextBlocklist.json @@ -0,0 +1,11 @@ +{ + "title": "Delete Text Blocklist By blocklistName", + "operationId": "TextBlocklists_DeleteTextBlocklist", + "parameters": { + "api-version": "2023-12-30-preview", + "blocklistName": "TestBlocklist" + }, + "responses": { + "204": {} + } +} diff --git a/specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/GetTextBlocklist.json b/specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/GetTextBlocklist.json new file mode 100644 index 000000000000..73786c7a4c36 --- /dev/null +++ b/specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/GetTextBlocklist.json @@ -0,0 +1,16 @@ +{ + "title": "Get Text Blocklist By blocklistName", + "operationId": "TextBlocklists_GetTextBlocklist", + "parameters": { + "api-version": "2023-12-30-preview", + "blocklistName": "TestBlocklist" + }, + "responses": { + "200": { + "body": { + "blocklistName": "TestBlocklist", + "description": "Test Blocklist" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/GetTextBlocklistItem.json b/specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/GetTextBlocklistItem.json new file mode 100644 index 000000000000..c5e7eaf86b46 --- /dev/null +++ b/specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/GetTextBlocklistItem.json @@ -0,0 +1,18 @@ +{ + "title": "Get BlockItem By blocklistName And blocklistItemId", + "operationId": "TextBlocklists_GetTextBlocklistItem", + "parameters": { + "api-version": "2023-12-30-preview", + "blocklistName": "TestBlocklist", + "blocklistItemId": "9511969e-f1e3-4604-9127-05ee16c509ec" + }, + "responses": { + "200": { + "body": { + "blocklistItemId": "9511969e-f1e3-4604-9127-05ee16c509ec", + "description": "Hate word", + "text": "hate" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/ListTextBlocklistItems.json b/specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/ListTextBlocklistItems.json new file mode 100644 index 000000000000..13352ef1692c --- /dev/null +++ b/specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/ListTextBlocklistItems.json @@ -0,0 +1,21 @@ +{ + "title": "Get All BlockItems By blocklistName", + "operationId": "TextBlocklists_ListTextBlocklistItems", + "parameters": { + "api-version": "2023-12-30-preview", + "blocklistName": "TestBlocklist" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "blocklistItemId": "9511969e-f1e3-4604-9127-05ee16c509ec", + "description": "Hate word", + "text": "hate" + } + ] + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/ListTextBlocklists.json b/specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/ListTextBlocklists.json new file mode 100644 index 000000000000..65dc19eec7b3 --- /dev/null +++ b/specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/ListTextBlocklists.json @@ -0,0 +1,19 @@ +{ + "title": "Get All Text Blocklists", + "operationId": "TextBlocklists_ListTextBlocklists", + "parameters": { + "api-version": "2023-12-30-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "blocklistName": "TestBlocklist", + "description": "Test Blocklist" + } + ] + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/RemoveBlocklistItems.json b/specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/RemoveBlocklistItems.json new file mode 100644 index 000000000000..a9a603bc3d80 --- /dev/null +++ b/specification/cognitiveservices/data-plane/ContentSafety/preview/2023-10-30-preview/examples/RemoveBlocklistItems.json @@ -0,0 +1,16 @@ +{ + "title": "Remove BlockItems From Text Blocklist", + "operationId": "TextBlocklists_RemoveBlocklistItems", + "parameters": { + "api-version": "2023-12-30-preview", + "blocklistName": "TestBlocklist", + "body": { + "blocklistItemIds": [ + "9511969e-f1e3-4604-9127-05ee16c509ec" + ] + } + }, + "responses": { + "204": {} + } +} diff --git a/specification/cognitiveservices/data-plane/ContentSafety/preview/2024-01-30-preview/contentsafety.json b/specification/cognitiveservices/data-plane/ContentSafety/preview/2024-01-30-preview/contentsafety.json new file mode 100644 index 000000000000..208f36065325 --- /dev/null +++ b/specification/cognitiveservices/data-plane/ContentSafety/preview/2024-01-30-preview/contentsafety.json @@ -0,0 +1,3059 @@ +{ + "swagger": "2.0", + "info": { + "title": "ContentSafety Service", + "version": "2024-01-30-preview", + "description": "Analyze harmful content", + "x-typespec-generated": [ + { + "emitter": "@azure-tools/typespec-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "x-ms-parameterized-host": { + "hostTemplate": "{endpoint}/contentsafety", + "useSchemePrefix": false, + "parameters": [ + { + "name": "endpoint", + "in": "path", + "description": "Supported Cognitive Services endpoints (protocol and hostname, for example:\nhttps://.cognitiveservices.azure.com).", + "required": true, + "type": "string" + } + ] + }, + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "security": [ + { + "ApiKeyAuth": [] + }, + { + "OAuth2Auth": [ + "https://cognitiveservices.azure.com/.default" + ] + } + ], + "securityDefinitions": { + "ApiKeyAuth": { + "type": "apiKey", + "name": "Ocp-Apim-Subscription-Key", + "in": "header" + }, + "OAuth2Auth": { + "type": "oauth2", + "flow": "application", + "scopes": { + "https://cognitiveservices.azure.com/.default": "" + }, + "tokenUrl": "https://login.microsoftonline.com/common/oauth2/v2.0/token" + } + }, + "tags": [], + "paths": { + "/image/incidents": { + "get": { + "operationId": "ImageIncidents_ListIncidents", + "summary": "Get All Image Incidents", + "description": "Get all incidents details.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "$ref": "#/parameters/Azure.Core.TopQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.SkipQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.MaxPageSizeQueryParameter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedImageIncident" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/image/incidents/{incidentName}": { + "get": { + "operationId": "ImageIncidents_GetIncidents", + "summary": "Get Image Incident By incidentName", + "description": "Returns image incident details.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "incidentName", + "in": "path", + "description": "incident name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/ImageIncident" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + }, + "patch": { + "operationId": "ImageIncidents_CreateOrUpdateIncident", + "summary": "Create Or Update Image Incident", + "description": "Updates a image incident. If the image incident does not exist, a new image incident will be created.", + "consumes": [ + "application/merge-patch+json" + ], + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "incidentName", + "in": "path", + "description": "incident name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + }, + { + "name": "resource", + "in": "body", + "description": "The resource instance.", + "required": true, + "schema": { + "$ref": "#/definitions/ImageIncidentCreateOrUpdate" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/ImageIncident" + } + }, + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "schema": { + "$ref": "#/definitions/ImageIncident" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + }, + "delete": { + "operationId": "ImageIncidents_DeleteIncident", + "summary": "Delete Image Incident By incidentName", + "description": "Deletes a image incident.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "incidentName", + "in": "path", + "description": "incident name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful. " + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/image/incidents/{incidentName}:addIncidentSamples": { + "post": { + "operationId": "ImageIncidents_AddIncidentSamples", + "summary": "Add ImageIncidentSamples To Incident", + "description": "Add imageIncidentSamples to an incident. You can add at most 100 imageIncidentSamples in one request.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "incidentName", + "in": "path", + "description": "incident name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AddImageIncidentSamplesOptions" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/AddImageIncidentSamplesResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/image/incidents/{incidentName}:removeIncidentSamples": { + "post": { + "operationId": "ImageIncidents_RemoveIncidentSamples", + "summary": "Remove ImageIncidentSamples From Incident", + "description": "Remove imageIncidentSamples from an incident. You can remove at most 100 Image Incident in one request.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "incidentName", + "in": "path", + "description": "incident name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RemoveImageIncidentSamplesOptions" + } + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful. " + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/image/incidents/{incidentName}/incidentSamples": { + "get": { + "operationId": "ImageIncidents_ListIncidentSamples", + "summary": "Get All ImageIncidentSamples By imageIncidentName", + "description": "Get all ImageIncidentSamples in a image incident.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "incidentName", + "in": "path", + "description": "incident name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + }, + { + "$ref": "#/parameters/Azure.Core.TopQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.SkipQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.MaxPageSizeQueryParameter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedListImageIncidentSampleResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/image/incidents/{incidentName}/incidentSamples/{incidentSampleId}": { + "get": { + "operationId": "ImageIncidents_GetIncidentSample", + "summary": "Get ImageIncidentSample By imageIncidentName And imageIncidentSampleId", + "description": "Get imageIncidentSample by imageIncidentName and imageIncidentSampleId from a image incident.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "incidentName", + "in": "path", + "description": "incident name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + }, + { + "name": "incidentSampleId", + "in": "path", + "description": "incident name.", + "required": true, + "type": "string", + "maxLength": 64 + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/ImageIncidentSampleResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/image:analyze": { + "post": { + "operationId": "ImageOperations_AnalyzeImage", + "summary": "Analyze Image", + "description": "A synchronous API for the analysis of potentially harmful image content. Currently, it supports four categories: Hate, SelfHarm, Sexual, and Violence.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "body", + "in": "body", + "description": "The image analysis request.", + "required": true, + "schema": { + "$ref": "#/definitions/AnalyzeImageOptions" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/AnalyzeImageResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/imageWithText:analyze": { + "post": { + "operationId": "ImageWithTextOperations_AnalyzeImageWithText", + "summary": "Analyze Image With Text", + "description": "A synchronous API for the analysis of potentially harmful image with text content. Currently, it supports four categories: Hate, SelfHarm, Sexual, and Violence.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "body", + "in": "body", + "description": "The image with text analysis request.", + "required": true, + "schema": { + "$ref": "#/definitions/AnalyzeImageWithTextOptions" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/AnalyzeImageWithTextResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/text/blocklists": { + "get": { + "operationId": "TextBlocklists_ListTextBlocklists", + "summary": "Get All Text Blocklists", + "description": "Get all text blocklists details.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedTextBlocklist" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/text/blocklists/{blocklistName}": { + "get": { + "operationId": "TextBlocklists_GetTextBlocklist", + "summary": "Get Text Blocklist By blocklistName", + "description": "Returns text blocklist details.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "blocklistName", + "in": "path", + "description": "Text blocklist name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/TextBlocklist" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + }, + "patch": { + "operationId": "TextBlocklists_CreateOrUpdateTextBlocklist", + "summary": "Create Or Update Text Blocklist", + "description": "Updates a text blocklist. If the blocklistName does not exist, a new blocklist will be created.", + "consumes": [ + "application/merge-patch+json" + ], + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "blocklistName", + "in": "path", + "description": "Text blocklist name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + }, + { + "name": "resource", + "in": "body", + "description": "The resource instance.", + "required": true, + "schema": { + "$ref": "#/definitions/TextBlocklistCreateOrUpdate" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/TextBlocklist" + } + }, + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "schema": { + "$ref": "#/definitions/TextBlocklist" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + }, + "delete": { + "operationId": "TextBlocklists_DeleteTextBlocklist", + "summary": "Delete Text Blocklist By blocklistName", + "description": "Deletes a text blocklist.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "blocklistName", + "in": "path", + "description": "Text blocklist name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful. " + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/text/blocklists/{blocklistName}:addOrUpdateBlocklistItems": { + "post": { + "operationId": "TextBlocklists_AddOrUpdateBlocklistItems", + "summary": "Add or update BlocklistItems To Text Blocklist", + "description": "Add or update blocklistItems to a text blocklist. You can add or update at most 100 blocklistItems in one request.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "blocklistName", + "in": "path", + "description": "Text blocklist name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + }, + { + "name": "body", + "in": "body", + "description": "Options for adding or updating blocklist items.", + "required": true, + "schema": { + "$ref": "#/definitions/AddOrUpdateTextBlocklistItemsOptions" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/AddOrUpdateTextBlocklistItemsResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/text/blocklists/{blocklistName}:removeBlocklistItems": { + "post": { + "operationId": "TextBlocklists_RemoveBlocklistItems", + "summary": "Remove BlocklistItems From Text Blocklist", + "description": "Remove blocklistItems from a text blocklist. You can remove at most 100 BlocklistItems in one request.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "blocklistName", + "in": "path", + "description": "Text blocklist name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + }, + { + "name": "body", + "in": "body", + "description": "Options for removing blocklist items.", + "required": true, + "schema": { + "$ref": "#/definitions/RemoveTextBlocklistItemsOptions" + } + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful. " + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/text/blocklists/{blocklistName}/blocklistItems": { + "get": { + "operationId": "TextBlocklists_ListTextBlocklistItems", + "summary": "Get All BlocklistItems By blocklistName", + "description": "Get all blocklistItems in a text blocklist.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "blocklistName", + "in": "path", + "description": "Text blocklist name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + }, + { + "$ref": "#/parameters/Azure.Core.TopQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.SkipQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.MaxPageSizeQueryParameter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedTextBlocklistItem" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/text/blocklists/{blocklistName}/blocklistItems/{blocklistItemId}": { + "get": { + "operationId": "TextBlocklists_GetTextBlocklistItem", + "summary": "Get BlocklistItem By blocklistName And blocklistItemId", + "description": "Get blocklistItem by blocklistName and blocklistItemId from a text blocklist.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "blocklistName", + "in": "path", + "description": "Text blocklist name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + }, + { + "name": "blocklistItemId", + "in": "path", + "description": "The service will generate a BlocklistItemId, which will be a UUID.", + "required": true, + "type": "string", + "maxLength": 64 + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/TextBlocklistItem" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/text/categories": { + "get": { + "operationId": "TextCategoryCustomization_ListTextCustomizedCategory", + "description": "Resource list operation template.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "$ref": "#/parameters/Azure.Core.TopQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.SkipQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.MaxPageSizeQueryParameter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedTextCustomizedCategory" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/text/categories/{categoryName}": { + "get": { + "operationId": "TextCategoryCustomization_GetTextCustomizedCategory", + "description": "Resource read operation template.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "categoryName", + "in": "path", + "description": "Text customizedCategories name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^Customized_[0-9A-Za-z._~-]+$" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/TextCustomizedCategory" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + }, + "put": { + "operationId": "TextCategoryCustomization_CreateOrReplaceTextCustomizedCategory", + "description": "Create or replace operation template.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "categoryName", + "in": "path", + "description": "Text customizedCategories name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^Customized_[0-9A-Za-z._~-]+$" + }, + { + "name": "resource", + "in": "body", + "description": "The resource instance.", + "required": true, + "schema": { + "$ref": "#/definitions/TextCustomizedCategory" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/TextCustomizedCategory" + } + }, + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "schema": { + "$ref": "#/definitions/TextCustomizedCategory" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + }, + "delete": { + "operationId": "TextCategoryCustomization_DeleteTextCustomizedCategory", + "description": "Resource delete operation template.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "categoryName", + "in": "path", + "description": "Text customizedCategories name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^Customized_[0-9A-Za-z._~-]+$" + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful. " + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/text/incidents": { + "get": { + "operationId": "TextIncidents_ListIncidents", + "summary": "Get All Text Incidents", + "description": "Get all incidents details.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "$ref": "#/parameters/Azure.Core.TopQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.SkipQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.MaxPageSizeQueryParameter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedTextIncident" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/text/incidents/{incidentName}": { + "get": { + "operationId": "TextIncidents_GetIncidents", + "summary": "Get Text Incident By incidentName", + "description": "Returns text incident details.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "incidentName", + "in": "path", + "description": "incident name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/TextIncident" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + }, + "patch": { + "operationId": "TextIncidents_CreateOrUpdateIncident", + "summary": "Create Or Update Text Incident", + "description": "Updates a text incident. If the text incident does not exist, a new text incident will be created.", + "consumes": [ + "application/merge-patch+json" + ], + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "incidentName", + "in": "path", + "description": "incident name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + }, + { + "name": "resource", + "in": "body", + "description": "The resource instance.", + "required": true, + "schema": { + "$ref": "#/definitions/TextIncidentCreateOrUpdate" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/TextIncident" + } + }, + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "schema": { + "$ref": "#/definitions/TextIncident" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + }, + "delete": { + "operationId": "TextIncidents_DeleteIncident", + "summary": "Delete Text Incident By incidentName", + "description": "Deletes a text incident.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "incidentName", + "in": "path", + "description": "incident name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful. " + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/text/incidents/{incidentName}:addIncidentSamples": { + "post": { + "operationId": "TextIncidents_AddIncidentSamples", + "summary": "Add TextIncidentSamples To Incident", + "description": "Add textIncidentSamples to an incident. You can add at most 100 textIncidentSamples in one request.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "incidentName", + "in": "path", + "description": "incident name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AddTextIncidentSamplesOptions" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/AddTextIncidentSamplesResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/text/incidents/{incidentName}:removeIncidentSamples": { + "post": { + "operationId": "TextIncidents_RemoveIncidentSamples", + "summary": "Remove TextIncidentSamples From Incident", + "description": "Remove textIncidentSamples from an incident. You can remove at most 100 Text Incident in one request.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "incidentName", + "in": "path", + "description": "incident name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RemoveTextIncidentSamplesOptions" + } + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful. " + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/text/incidents/{incidentName}/incidentSamples": { + "get": { + "operationId": "TextIncidents_ListIncidentSamples", + "summary": "Get All TextIncidentSamples By textIncidentName", + "description": "Get all TextIncidentSamples in a text incident.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "incidentName", + "in": "path", + "description": "incident name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + }, + { + "$ref": "#/parameters/Azure.Core.TopQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.SkipQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.MaxPageSizeQueryParameter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedTextIncidentSample" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/text/incidents/{incidentName}/incidentSamples/{incidentSampleId}": { + "get": { + "operationId": "TextIncidents_GetIncidentSample", + "summary": "Get TextIncidentSample By textIncidentName And textIncidentSampleId", + "description": "Get textIncidentSample by textIncidentName and textIncidentSampleId from a text incident.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "incidentName", + "in": "path", + "description": "incident name.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$" + }, + { + "name": "incidentSampleId", + "in": "path", + "description": "incident name.", + "required": true, + "type": "string", + "maxLength": 64 + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/TextIncidentSample" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/text:adaptiveAnnotate": { + "post": { + "operationId": "PromptTextOperations_AnnotateText", + "summary": "Annotate Text by Prompt", + "description": "A remote procedure call (RPC) operation.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "body", + "in": "body", + "description": "The text analysis request.", + "required": true, + "schema": { + "$ref": "#/definitions/AnnotateTextOptions" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/AnnotateTextResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/text:analyze": { + "post": { + "operationId": "TextOperations_AnalyzeText", + "summary": "Analyze Text", + "description": "A synchronous API for the analysis of potentially harmful text content. Currently, it supports four categories: Hate, SelfHarm, Sexual, and Violence.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "body", + "in": "body", + "description": "The text analysis request.", + "required": true, + "schema": { + "$ref": "#/definitions/AnalyzeTextOptions" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/AnalyzeTextResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/text:detectJailbreak": { + "post": { + "operationId": "TextOperations_DetectTextJailbreak", + "summary": "Analyze Text Jailbreak", + "description": "A synchronous API for the analysis of text jailbreak.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "body", + "in": "body", + "description": "The text jailbreak analysis request.", + "required": true, + "schema": { + "$ref": "#/definitions/AnalyzeTextJailbreakOptions" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/AnalyzeTextJailbreakResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/text:detectProtectedMaterial": { + "post": { + "operationId": "TextOperations_DetectTextProtectedMaterial", + "summary": "Analyze Protected Material", + "description": "A synchronous API for the analysis of protected material.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "body", + "in": "body", + "description": "The text protected material analysis request.", + "required": true, + "schema": { + "$ref": "#/definitions/AnalyzeTextProtectedMaterialOptions" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/AnalyzeTextProtectedMaterialResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/text:detectUngroundedness": { + "post": { + "operationId": "TextUngroundednessDetectionOperations_DetectUngroundedness", + "summary": "Detect Ungrounded Information", + "description": "A synchronous API for the analysis of language model outputs to determine alignment with user-provided information or identify fictional content.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "body", + "in": "body", + "description": "The ungroundedness detection request.", + "required": true, + "schema": { + "$ref": "#/definitions/DetectUngroundednessOptions" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/DetectUngroundednessResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + } + }, + "definitions": { + "AddImageIncidentSamplesOptions": { + "type": "object", + "description": "The request to add incidentSamples to a incident.", + "properties": { + "incidentSamples": { + "type": "array", + "description": "Array of incidentSamples to add.", + "items": { + "$ref": "#/definitions/ImageIncidentSample" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "incidentSamples" + ] + }, + "AddImageIncidentSamplesResult": { + "type": "object", + "description": "The response of adding incidentSamples to the incident.", + "properties": { + "incidentSamples": { + "type": "array", + "description": "Array of incidentSamples have been added.", + "items": { + "$ref": "#/definitions/ListImageIncidentSampleResult" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "incidentSamples" + ] + }, + "AddOrUpdateTextBlocklistItemsOptions": { + "type": "object", + "description": "The request to add blocklistItems to a text blocklist.", + "properties": { + "blocklistItems": { + "type": "array", + "description": "Array of blocklistItems to add.", + "items": { + "$ref": "#/definitions/TextBlocklistItem" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "blocklistItems" + ] + }, + "AddOrUpdateTextBlocklistItemsResult": { + "type": "object", + "description": "The response of adding blocklistItems to the text blocklist.", + "properties": { + "blocklistItems": { + "type": "array", + "description": "Array of blocklistItems have been added.", + "items": { + "$ref": "#/definitions/TextBlocklistItem" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "blocklistItems" + ] + }, + "AddTextIncidentSamplesOptions": { + "type": "object", + "description": "The request to add incidentSamples to a incident.", + "properties": { + "incidentSamples": { + "type": "array", + "description": "Array of incidentSamples to add.", + "items": { + "$ref": "#/definitions/TextIncidentSample" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "incidentSamples" + ] + }, + "AddTextIncidentSamplesResult": { + "type": "object", + "description": "The response of adding incidentSamples to the incident.", + "properties": { + "incidentSamples": { + "type": "array", + "description": "Array of incidentSamples have been added.", + "items": { + "$ref": "#/definitions/TextIncidentSample" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "incidentSamples" + ] + }, + "AnalyzeImageOptions": { + "type": "object", + "description": "The image analysis request.", + "properties": { + "image": { + "$ref": "#/definitions/ImageData", + "description": "The image needs to be analyzed." + }, + "categories": { + "type": "array", + "description": "The categories will be analyzed. If they are not assigned, a default set of analysis results for the categories will be returned.", + "items": { + "$ref": "#/definitions/ImageCategory" + } + }, + "outputType": { + "$ref": "#/definitions/AnalyzeImageOutputType", + "description": "This refers to the type of image analysis output. If no value is assigned, the default value will be \"FourSeverityLevels\".", + "default": "FourSeverityLevels" + }, + "incidents": { + "$ref": "#/definitions/IncidentOptions", + "description": "The incidents to detect." + } + }, + "required": [ + "image" + ] + }, + "AnalyzeImageOutputType": { + "type": "string", + "description": "The type of image analysis output.", + "enum": [ + "FourSeverityLevels" + ], + "x-ms-enum": { + "name": "AnalyzeImageOutputType", + "modelAsString": true, + "values": [ + { + "name": "FourSeverityLevels", + "value": "FourSeverityLevels", + "description": "Output severities in four levels, the value could be 0,2,4,6." + } + ] + } + }, + "AnalyzeImageResult": { + "type": "object", + "description": "The image analysis response.", + "properties": { + "categoriesAnalysis": { + "type": "array", + "description": "Analysis result for categories.", + "items": { + "$ref": "#/definitions/ImageCategoriesAnalysis" + }, + "x-ms-identifiers": [] + }, + "incidentMatches": { + "type": "array", + "description": "The incident match details.", + "items": { + "$ref": "#/definitions/IncidentMatch" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "categoriesAnalysis" + ] + }, + "AnalyzeImageWithTextOptions": { + "type": "object", + "description": "The analysis request of the image with text.", + "properties": { + "image": { + "$ref": "#/definitions/ImageData", + "description": "The image needs to be analyzed." + }, + "text": { + "type": "string", + "description": "The text attached to the image. We support at most 1k characters (unicode code points) in one text request.", + "maxLength": 1000 + }, + "categories": { + "type": "array", + "description": "The categories will be analyzed. If they are not assigned, a default set of analysis results for the categories will be returned.", + "items": { + "$ref": "#/definitions/ImageWithTextCategory" + } + }, + "enableOcr": { + "type": "boolean", + "description": "When set to true, our service will perform OCR and concatenate the recognized text with input text before analyzing. We will recognize at most 256 characters (unicode code points) from input image. The others will be truncated." + } + }, + "required": [ + "image", + "enableOcr" + ] + }, + "AnalyzeImageWithTextResult": { + "type": "object", + "description": "The analysis response of the image with text.", + "properties": { + "categoriesAnalysis": { + "type": "array", + "description": "Analysis result for categories.", + "items": { + "$ref": "#/definitions/ImageWithTextCategoriesAnalysis" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "categoriesAnalysis" + ] + }, + "AnalyzeTextJailbreakOptions": { + "type": "object", + "description": "The text jailbreak analysis request.", + "properties": { + "text": { + "type": "string", + "description": "The text needs to be analyzed if it attempt to jailbreak. We support a maximum of 1k Unicode characters (Unicode code points) in the text of one request.", + "maxLength": 1000 + } + }, + "required": [ + "text" + ] + }, + "AnalyzeTextJailbreakResult": { + "type": "object", + "description": "The text jailbreak analysis request.", + "properties": { + "jailbreakAnalysis": { + "$ref": "#/definitions/JailbreakAnalysisResult", + "description": "Analysis result for jailbreak." + } + }, + "required": [ + "jailbreakAnalysis" + ] + }, + "AnalyzeTextOptions": { + "type": "object", + "description": "The text analysis request.", + "properties": { + "text": { + "type": "string", + "description": "The text needs to be analyzed. We support a maximum of 10k Unicode characters (Unicode code points) in the text of one request.", + "maxLength": 10000 + }, + "categories": { + "type": "array", + "description": "The categories will be analyzed. If they are not assigned, a default set of analysis results for the categories will be returned.", + "items": { + "$ref": "#/definitions/TextCategory" + } + }, + "blocklistNames": { + "type": "array", + "description": "The names of blocklists.", + "items": { + "type": "string" + } + }, + "haltOnBlocklistHit": { + "type": "boolean", + "description": "When set to true, further analyses of harmful content will not be performed in cases where blocklists are hit. When set to false, all analyses of harmful content will be performed, whether or not blocklists are hit." + }, + "outputType": { + "$ref": "#/definitions/AnalyzeTextOutputType", + "description": "This refers to the type of text analysis output. If no value is assigned, the default value will be \"FourSeverityLevels\".", + "default": "FourSeverityLevels" + }, + "incidents": { + "$ref": "#/definitions/IncidentOptions", + "description": "The incidents to detect." + } + }, + "required": [ + "text" + ] + }, + "AnalyzeTextOutputType": { + "type": "string", + "description": "The type of text analysis output.", + "enum": [ + "FourSeverityLevels", + "EightSeverityLevels" + ], + "x-ms-enum": { + "name": "AnalyzeTextOutputType", + "modelAsString": true, + "values": [ + { + "name": "FourSeverityLevels", + "value": "FourSeverityLevels", + "description": "Output severities in four levels, the value could be 0,2,4,6." + }, + { + "name": "EightSeverityLevels", + "value": "EightSeverityLevels", + "description": "Output severities in eight levels, the value could be 0,1,2,3,4,5,6,7." + } + ] + } + }, + "AnalyzeTextProtectedMaterialOptions": { + "type": "object", + "description": "The protected material analysis request.", + "properties": { + "text": { + "type": "string", + "description": "The text needs to be analyzed. We support a maximum of 1k Unicode characters (Unicode code points) in the text of one request.", + "maxLength": 1000 + } + }, + "required": [ + "text" + ] + }, + "AnalyzeTextProtectedMaterialResult": { + "type": "object", + "description": "The protected material analysis response.", + "properties": { + "protectedMaterialAnalysis": { + "$ref": "#/definitions/ProtectedMaterialAnalysisResult", + "description": "Analysis result for protected material." + } + }, + "required": [ + "protectedMaterialAnalysis" + ] + }, + "AnalyzeTextResult": { + "type": "object", + "description": "The text analysis response.", + "properties": { + "blocklistsMatch": { + "type": "array", + "description": "The blocklist match details.", + "items": { + "$ref": "#/definitions/TextBlocklistMatch" + }, + "x-ms-identifiers": [] + }, + "categoriesAnalysis": { + "type": "array", + "description": "Analysis result for categories.", + "items": { + "$ref": "#/definitions/TextCategoriesAnalysis" + }, + "x-ms-identifiers": [] + }, + "incidentMatches": { + "type": "array", + "description": "The incident match details.", + "items": { + "$ref": "#/definitions/IncidentMatch" + }, + "x-ms-identifiers": [] + }, + "citation": { + "type": "array", + "description": "Chunks in the original text detected as harmful content. Analysis result and scores are caused by these.", + "items": { + "type": "string" + } + } + }, + "required": [ + "categoriesAnalysis" + ] + }, + "AnnotateTextOptions": { + "type": "object", + "description": "Annotate text options", + "properties": { + "text": { + "type": "string", + "description": "The text needs to be analyzed. We support a maximum of 10k Unicode characters (Unicode code points) in the text of one request.", + "maxLength": 10000 + }, + "category": { + "type": "string", + "description": "The category will be analyzed, you can set your customized category or one of built-in categories in 'Hate','Selfharm', 'Sexual' and 'Violence'." + } + }, + "required": [ + "text", + "category" + ] + }, + "AnnotateTextResult": { + "type": "object", + "description": "The text annotation response.", + "properties": { + "id": { + "type": "integer", + "format": "int32", + "description": "The id of annotated subcategory." + }, + "name": { + "type": "string", + "description": "The name of annotated subcategory." + }, + "reasoning": { + "type": "string", + "description": "The reasoning." + } + }, + "required": [ + "id", + "name" + ] + }, + "Azure.Core.Foundations.Error": { + "type": "object", + "description": "The error object.", + "properties": { + "code": { + "type": "string", + "description": "One of a server-defined set of error codes." + }, + "message": { + "type": "string", + "description": "A human-readable representation of the error." + }, + "target": { + "type": "string", + "description": "The target of the error." + }, + "details": { + "type": "array", + "description": "An array of details about specific errors that led to this reported error.", + "items": { + "$ref": "#/definitions/Azure.Core.Foundations.Error" + }, + "x-ms-identifiers": [] + }, + "innererror": { + "$ref": "#/definitions/Azure.Core.Foundations.InnerError", + "description": "An object containing more specific information than the current object about the error." + } + }, + "required": [ + "code", + "message" + ] + }, + "Azure.Core.Foundations.ErrorResponse": { + "type": "object", + "description": "A response containing error details.", + "properties": { + "error": { + "$ref": "#/definitions/Azure.Core.Foundations.Error", + "description": "The error object." + } + }, + "required": [ + "error" + ] + }, + "Azure.Core.Foundations.InnerError": { + "type": "object", + "description": "An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.", + "properties": { + "code": { + "type": "string", + "description": "One of a server-defined set of error codes." + }, + "innererror": { + "$ref": "#/definitions/Azure.Core.Foundations.InnerError", + "description": "Inner error." + } + } + }, + "DetectUngroundednessOptions": { + "type": "object", + "description": "The request of ungroundedness detection.", + "properties": { + "domain": { + "$ref": "#/definitions/Domain", + "description": "The domain of the text for analysis.\nThis field is optional, with a default value of Generic." + }, + "task": { + "$ref": "#/definitions/Task", + "description": "The task type for the text analysis.\nThis field is optional, with a default value of Summarization." + }, + "query": { + "type": "string", + "description": "The user's question input in a QnA scenario.\nThis field is optional, but if the task type is set to QnA, it becomes required." + }, + "text": { + "type": "string", + "description": "The text requiring analysis." + }, + "groundingSources": { + "type": "array", + "description": "The source information used as a grounding reference.", + "items": { + "type": "string" + } + }, + "reasoning": { + "type": "boolean", + "description": "A value indicating if the output includes an explanation for the identified ungroundedness.\nThis field is optional, with a default value of false." + }, + "gptResource": { + "$ref": "#/definitions/GptResource", + "description": "Connection details for the GPT resource. \nThis field will be used only when the 'reasoning' field is set to true; otherwise, it will be ignored." + } + }, + "required": [ + "text", + "groundingSources" + ] + }, + "DetectUngroundednessResult": { + "type": "object", + "description": "The response of ungroundedness detection.", + "properties": { + "ungrounded": { + "type": "boolean", + "description": "Detection result for ungrounded text." + }, + "confidenceScore": { + "type": "number", + "format": "float", + "description": "Confidence score of the model in the analysis results." + }, + "ungroundedPercentage": { + "type": "number", + "format": "float", + "description": "Percentage of ungrounded Text." + }, + "ungroundedDetails": { + "type": "array", + "description": "The detailed information about a text identified as ungrounded.", + "items": { + "$ref": "#/definitions/UngroundedDetails" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "ungrounded", + "confidenceScore", + "ungroundedPercentage", + "ungroundedDetails" + ] + }, + "Domain": { + "type": "string", + "description": "Domain.", + "enum": [ + "Generic", + "Medical" + ], + "x-ms-enum": { + "name": "Domain", + "modelAsString": true + } + }, + "GptResource": { + "type": "object", + "description": "Connection details for the GPT resource.", + "properties": { + "azureOpenAIEndpoint": { + "type": "string", + "description": "Endpoint for Azure OpenAI resource." + }, + "deploymentName": { + "type": "string", + "description": "Deployment model name." + } + }, + "required": [ + "azureOpenAIEndpoint", + "deploymentName" + ] + }, + "ImageCategoriesAnalysis": { + "type": "object", + "description": "Image analysis result.", + "properties": { + "category": { + "$ref": "#/definitions/ImageCategory", + "description": "The image analysis category." + }, + "severity": { + "type": "integer", + "format": "int32", + "description": "The value increases with the severity of the input content. The value of this field is determined by the output type specified in the request. The output type could be ‘FourSeverityLevels’, and the output value can be 0, 2, 4, 6." + } + }, + "required": [ + "category" + ] + }, + "ImageCategory": { + "type": "string", + "description": "Image analyze category.", + "enum": [ + "Hate", + "SelfHarm", + "Sexual", + "Violence" + ], + "x-ms-enum": { + "name": "ImageCategory", + "modelAsString": true + } + }, + "ImageData": { + "type": "object", + "description": "The image can be either base64 encoded bytes or a blob URL. You can choose only one of these options. If both are provided, the request will be refused. The maximum image size is 2048 x 2048 pixels and should not exceed 4 MB, while the minimum image size is 50 x 50 pixels.", + "properties": { + "content": { + "type": "string", + "format": "byte", + "description": "The Base64 encoding of the image." + }, + "blobUrl": { + "type": "string", + "format": "uri", + "description": "The blob url of the image." + } + } + }, + "ImageDataResult": { + "type": "object", + "description": "The image result is base64 encoded bytes", + "properties": { + "content": { + "type": "string", + "format": "byte", + "description": "The Base64 encoding of the image." + } + } + }, + "ImageIncident": { + "type": "object", + "description": "Image Incident.", + "properties": { + "incidentName": { + "type": "string", + "description": "incident name.", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$", + "x-ms-mutability": [ + "read", + "create" + ] + }, + "description": { + "type": "string", + "description": "Incident description.", + "maxLength": 1024 + }, + "created": { + "type": "string", + "format": "date-time", + "description": "Incident created time.", + "x-ms-mutability": [ + "read" + ] + }, + "lastUpdated": { + "type": "string", + "format": "date-time", + "description": "Incident updated time.", + "x-ms-mutability": [ + "read" + ] + } + }, + "required": [ + "incidentName", + "created", + "lastUpdated" + ] + }, + "ImageIncidentCreateOrUpdate": { + "type": "object", + "description": "Image Incident.", + "properties": { + "incidentName": { + "type": "string", + "description": "incident name.", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$", + "x-ms-mutability": [ + "read", + "create" + ] + }, + "description": { + "type": "string", + "description": "Incident description.", + "maxLength": 1024 + } + } + }, + "ImageIncidentSample": { + "type": "object", + "description": "Sample in an Image Incident.", + "properties": { + "incidentSampleId": { + "type": "string", + "description": "incident name.", + "maxLength": 64, + "readOnly": true + }, + "image": { + "$ref": "#/definitions/ImageData", + "description": "IncidentSample image content." + } + }, + "required": [ + "incidentSampleId" + ] + }, + "ImageIncidentSampleResult": { + "type": "object", + "description": "Sample Result in an Image Incident.", + "properties": { + "incidentSampleId": { + "type": "string", + "description": "incident name.", + "maxLength": 64, + "readOnly": true + }, + "image": { + "$ref": "#/definitions/ImageDataResult", + "description": "IncidentSample image content." + } + }, + "required": [ + "incidentSampleId" + ] + }, + "ImageWithTextCategoriesAnalysis": { + "type": "object", + "description": "ImageWithText analysis result.", + "properties": { + "category": { + "$ref": "#/definitions/ImageWithTextCategory", + "description": "The imageWithtext analysis category." + }, + "severity": { + "type": "integer", + "format": "int32", + "description": "The higher the severity of input content, the larger this value is. The values could be: 0,2,4,6." + } + }, + "required": [ + "category" + ] + }, + "ImageWithTextCategory": { + "type": "string", + "description": "ImageWithText analyze category.", + "enum": [ + "Hate", + "SelfHarm", + "Sexual", + "Violence" + ], + "x-ms-enum": { + "name": "ImageWithTextCategory", + "modelAsString": true + } + }, + "IncidentMatch": { + "type": "object", + "description": "The result of text incident match.", + "properties": { + "incidentName": { + "type": "string", + "description": "The name of the matched incident.", + "maxLength": 64 + } + }, + "required": [ + "incidentName" + ] + }, + "IncidentOptions": { + "type": "object", + "description": "The text analysis request.", + "properties": { + "incidentNames": { + "type": "array", + "description": "The accept decision made by service.", + "items": { + "type": "string" + } + }, + "haltOnIncidentHit": { + "type": "boolean", + "description": "When set to true, further analyses of harmful content will not be performed in cases where incidents are hit. When set to false, all analyses of harmful content will be performed, whether or not incidents are hit." + } + } + }, + "JailbreakAnalysisResult": { + "type": "object", + "description": "The text jailbreak analysis response.", + "properties": { + "detected": { + "type": "boolean", + "description": "Analysis result for jailbreak." + } + }, + "required": [ + "detected" + ] + }, + "ListImageIncidentSampleResult": { + "type": "object", + "description": "Sample in a Image Incident.", + "properties": { + "incidentSampleId": { + "type": "string", + "description": "incident name.", + "maxLength": 64, + "readOnly": true + } + }, + "required": [ + "incidentSampleId" + ] + }, + "PagedImageIncident": { + "type": "object", + "description": "Paged collection of ImageIncident items", + "properties": { + "value": { + "type": "array", + "description": "The ImageIncident items on this page", + "items": { + "$ref": "#/definitions/ImageIncident" + }, + "x-ms-identifiers": [] + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "PagedListImageIncidentSampleResult": { + "type": "object", + "description": "Paged collection of ListImageIncidentSampleResult items", + "properties": { + "value": { + "type": "array", + "description": "The ListImageIncidentSampleResult items on this page", + "items": { + "$ref": "#/definitions/ListImageIncidentSampleResult" + }, + "x-ms-identifiers": [] + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "PagedTextBlocklist": { + "type": "object", + "description": "Paged collection of TextBlocklist items", + "properties": { + "value": { + "type": "array", + "description": "The TextBlocklist items on this page", + "items": { + "$ref": "#/definitions/TextBlocklist" + }, + "x-ms-identifiers": [] + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "PagedTextBlocklistItem": { + "type": "object", + "description": "Paged collection of TextBlocklistItem items", + "properties": { + "value": { + "type": "array", + "description": "The TextBlocklistItem items on this page", + "items": { + "$ref": "#/definitions/TextBlocklistItem" + }, + "x-ms-identifiers": [] + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "PagedTextCustomizedCategory": { + "type": "object", + "description": "Paged collection of TextCustomizedCategory items", + "properties": { + "value": { + "type": "array", + "description": "The TextCustomizedCategory items on this page", + "items": { + "$ref": "#/definitions/TextCustomizedCategory" + }, + "x-ms-identifiers": [] + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "PagedTextIncident": { + "type": "object", + "description": "Paged collection of TextIncident items", + "properties": { + "value": { + "type": "array", + "description": "The TextIncident items on this page", + "items": { + "$ref": "#/definitions/TextIncident" + }, + "x-ms-identifiers": [] + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "PagedTextIncidentSample": { + "type": "object", + "description": "Paged collection of TextIncidentSample items", + "properties": { + "value": { + "type": "array", + "description": "The TextIncidentSample items on this page", + "items": { + "$ref": "#/definitions/TextIncidentSample" + }, + "x-ms-identifiers": [] + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "PreDefinedConcept": { + "type": "object", + "description": "Pre-defined concept.", + "properties": { + "concept": { + "type": "string" + }, + "description": { + "type": "string" + } + }, + "required": [ + "concept", + "description" + ] + }, + "ProtectedMaterialAnalysisResult": { + "type": "object", + "description": "The text protected material analysis response.", + "properties": { + "detected": { + "type": "boolean", + "description": "Analysis result for protected material.." + } + }, + "required": [ + "detected" + ] + }, + "RemoveImageIncidentSamplesOptions": { + "type": "object", + "description": "The request to remove incidentSamples from a incident.", + "properties": { + "incidentSampleIds": { + "type": "array", + "description": "Array of incidentSamples to remove.", + "items": { + "type": "string" + } + } + }, + "required": [ + "incidentSampleIds" + ] + }, + "RemoveTextBlocklistItemsOptions": { + "type": "object", + "description": "The request to remove blocklistItems from a text blocklist.", + "properties": { + "blocklistItemIds": { + "type": "array", + "description": "Array of blocklistItemIds to remove.", + "items": { + "type": "string" + } + } + }, + "required": [ + "blocklistItemIds" + ] + }, + "RemoveTextIncidentSamplesOptions": { + "type": "object", + "description": "The request to remove incidentSamples from a incident.", + "properties": { + "incidentSampleIds": { + "type": "array", + "description": "Array of incidentSamples to remove.", + "items": { + "type": "string" + } + } + }, + "required": [ + "incidentSampleIds" + ] + }, + "SubCategory": { + "type": "object", + "description": "Label definition.", + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "name": { + "type": "string" + }, + "statements": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "id", + "name", + "statements" + ] + }, + "Task": { + "type": "string", + "description": "Task type.", + "enum": [ + "Summarization", + "QnA" + ], + "x-ms-enum": { + "name": "Task", + "modelAsString": true + } + }, + "TextBlocklist": { + "type": "object", + "description": "Text Blocklist.", + "properties": { + "blocklistName": { + "type": "string", + "description": "Text blocklist name.", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$", + "x-ms-mutability": [ + "read", + "create" + ] + }, + "description": { + "type": "string", + "description": "Text blocklist description.", + "maxLength": 1024 + } + }, + "required": [ + "blocklistName" + ] + }, + "TextBlocklistCreateOrUpdate": { + "type": "object", + "description": "Text Blocklist.", + "properties": { + "blocklistName": { + "type": "string", + "description": "Text blocklist name.", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$", + "x-ms-mutability": [ + "read", + "create" + ] + }, + "description": { + "type": "string", + "description": "Text blocklist description.", + "maxLength": 1024 + } + } + }, + "TextBlocklistItem": { + "type": "object", + "description": "Item in a TextBlocklist.", + "properties": { + "blocklistItemId": { + "type": "string", + "description": "The service will generate a BlocklistItemId, which will be a UUID.", + "maxLength": 64, + "readOnly": true + }, + "description": { + "type": "string", + "description": "BlocklistItem description.", + "maxLength": 1024 + }, + "text": { + "type": "string", + "description": "BlocklistItem content.", + "maxLength": 128 + } + }, + "required": [ + "blocklistItemId", + "text" + ] + }, + "TextBlocklistMatch": { + "type": "object", + "description": "The result of blocklist match.", + "properties": { + "blocklistName": { + "type": "string", + "description": "The name of the matched blocklist.", + "maxLength": 64 + }, + "blocklistItemId": { + "type": "string", + "description": "The ID of the matched item.", + "maxLength": 64 + }, + "blocklistItemText": { + "type": "string", + "description": "The content of the matched item.", + "maxLength": 128 + } + }, + "required": [ + "blocklistName", + "blocklistItemId", + "blocklistItemText" + ] + }, + "TextCategoriesAnalysis": { + "type": "object", + "description": "Text analysis result.", + "properties": { + "category": { + "$ref": "#/definitions/TextCategory", + "description": "The text analysis category." + }, + "severity": { + "type": "integer", + "format": "int32", + "description": "The value increases with the severity of the input content. The value of this field is determined by the output type specified in the request. The output type could be ‘FourSeverityLevels’ or ‘EightSeverity Levels’, and the output value can be 0, 2, 4, 6 or 0, 1, 2, 3, 4, 5, 6, or 7." + } + }, + "required": [ + "category" + ] + }, + "TextCategory": { + "type": "string", + "description": "Text analyze category.", + "enum": [ + "Hate", + "SelfHarm", + "Sexual", + "Violence" + ], + "x-ms-enum": { + "name": "TextCategory", + "modelAsString": true + } + }, + "TextCustomizedCategory": { + "type": "object", + "description": "Text Customized categories.", + "properties": { + "categoryName": { + "type": "string", + "description": "Text customizedCategories name.", + "maxLength": 64, + "pattern": "^Customized_[0-9A-Za-z._~-]+$", + "x-ms-mutability": [ + "read", + "create" + ] + }, + "preDefinedConcepts": { + "type": "array", + "items": { + "$ref": "#/definitions/PreDefinedConcept" + }, + "x-ms-identifiers": [] + }, + "subCategories": { + "type": "array", + "items": { + "$ref": "#/definitions/SubCategory" + } + }, + "emphases": { + "type": "array", + "items": { + "type": "string" + } + }, + "exampleBlobUrl": { + "type": "string", + "format": "uri" + } + }, + "required": [ + "categoryName", + "subCategories" + ] + }, + "TextIncident": { + "type": "object", + "description": "Text Incident.", + "properties": { + "incidentName": { + "type": "string", + "description": "incident name.", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$", + "x-ms-mutability": [ + "read", + "create" + ] + }, + "description": { + "type": "string", + "description": "Incident description.", + "maxLength": 1024 + }, + "created": { + "type": "string", + "format": "date-time", + "description": "Incident created time.", + "x-ms-mutability": [ + "read" + ] + }, + "lastUpdated": { + "type": "string", + "format": "date-time", + "description": "Incident updated time.", + "x-ms-mutability": [ + "read" + ] + } + }, + "required": [ + "incidentName", + "created", + "lastUpdated" + ] + }, + "TextIncidentCreateOrUpdate": { + "type": "object", + "description": "Text Incident.", + "properties": { + "incidentName": { + "type": "string", + "description": "incident name.", + "maxLength": 64, + "pattern": "^[0-9A-Za-z._~-]+$", + "x-ms-mutability": [ + "read", + "create" + ] + }, + "description": { + "type": "string", + "description": "Incident description.", + "maxLength": 1024 + } + } + }, + "TextIncidentSample": { + "type": "object", + "description": "Sample in a Text Incident.", + "properties": { + "incidentSampleId": { + "type": "string", + "description": "incident name.", + "maxLength": 64, + "readOnly": true + }, + "text": { + "type": "string", + "description": "IncidentSample text content.", + "maxLength": 1024 + } + }, + "required": [ + "incidentSampleId" + ] + }, + "UngroundedDetails": { + "type": "object", + "description": "The detailed information about a text identified as ungrounded.", + "properties": { + "text": { + "type": "string", + "description": "The ungrounded text." + }, + "reason": { + "type": "string", + "description": "The explanation for identifying the text as ungrounded. \nOnly when the 'reasoning' field in the input is set to true 'reason' field will be returned." + } + }, + "required": [ + "text" + ] + } + }, + "parameters": { + "Azure.Core.Foundations.ApiVersionParameter": { + "name": "api-version", + "in": "query", + "description": "The API version to use for this operation.", + "required": true, + "type": "string", + "minLength": 1, + "x-ms-parameter-location": "method", + "x-ms-client-name": "apiVersion" + }, + "Azure.Core.MaxPageSizeQueryParameter": { + "name": "maxpagesize", + "in": "query", + "description": "The maximum number of result items per page.", + "required": false, + "type": "integer", + "format": "int32", + "x-ms-parameter-location": "method" + }, + "Azure.Core.SkipQueryParameter": { + "name": "skip", + "in": "query", + "description": "The number of result items to skip.", + "required": false, + "type": "integer", + "format": "int32", + "default": 0, + "x-ms-parameter-location": "method" + }, + "Azure.Core.TopQueryParameter": { + "name": "top", + "in": "query", + "description": "The number of result items to return.", + "required": false, + "type": "integer", + "format": "int32", + "x-ms-parameter-location": "method" + } + } +} diff --git a/specification/cognitiveservices/data-plane/ContentSafety/readme.md b/specification/cognitiveservices/data-plane/ContentSafety/readme.md index 2635c4c7cf2d..b831713e2813 100644 --- a/specification/cognitiveservices/data-plane/ContentSafety/readme.md +++ b/specification/cognitiveservices/data-plane/ContentSafety/readme.md @@ -1,6 +1,6 @@ # Content Safety -> see https://aka.ms/autorest +> see This is the AutoRest configuration file for Content Safety.