Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

ContentSafetyClient Class

Package:
com.azure.ai.contentsafety
Maven Artifact:
com.azure:azure-ai-contentsafety:1.0.17
  • java.lang.Object
    • com.azure.ai.contentsafety.ContentSafetyClient

public final class ContentSafetyClient

Initializes a new instance of the synchronous ContentSafetyClient type.

Method Summary

Modifier and Type Method and Description
AnalyzeImageResult analyzeImage(AnalyzeImageOptions options)

Analyze Image A synchronous API for the analysis of potentially harmful image content.

AnalyzeImageResult analyzeImage(BinaryData content)

Analyze Image A synchronous API for the analysis of potentially harmful image content.

AnalyzeImageResult analyzeImage(String blobUrl)

Analyze Image A synchronous API for the analysis of potentially harmful image content.

Response<BinaryData> analyzeImageWithResponse(BinaryData options, RequestOptions requestOptions)

Analyze Image A synchronous API for the analysis of potentially harmful image content.

AnalyzeTextResult analyzeText(AnalyzeTextOptions options)

Analyze Text A synchronous API for the analysis of potentially harmful text content.

AnalyzeTextResult analyzeText(String text)

Analyze Text A synchronous API for the analysis of potentially harmful text content.

Response<BinaryData> analyzeTextWithResponse(BinaryData options, RequestOptions requestOptions)

Analyze Text A synchronous API for the analysis of potentially harmful text content.

Methods inherited from java.lang.Object

Method Details

analyzeImage

public AnalyzeImageResult analyzeImage(AnalyzeImageOptions options)

Analyze Image A synchronous API for the analysis of potentially harmful image content. Currently, it supports four categories: Hate, SelfHarm, Sexual, and Violence.

Parameters:

options - The image analysis request.

Returns:

the image analysis response.

analyzeImage

public AnalyzeImageResult analyzeImage(BinaryData content)

Analyze Image A synchronous API for the analysis of potentially harmful image content. Currently, it supports four categories: Hate, SelfHarm, Sexual, and Violence.

Parameters:

content - The image analysis request.

Returns:

the image analysis response.

analyzeImage

public AnalyzeImageResult analyzeImage(String blobUrl)

Analyze Image A synchronous API for the analysis of potentially harmful image content. Currently, it supports four categories: Hate, SelfHarm, Sexual, and Violence.

Parameters:

blobUrl - The image analysis request.

Returns:

the image analysis response.

analyzeImageWithResponse

public Response<BinaryData> analyzeImageWithResponse(BinaryData options, RequestOptions requestOptions)

Analyze Image A synchronous API for the analysis of potentially harmful image content. Currently, it supports four categories: Hate, SelfHarm, Sexual, and Violence.

Request Body Schema

{
 image (Required): {
 content: byte[] (Optional)
 blobUrl: String (Optional)
 }
 categories (Optional): [
 String(Hate/SelfHarm/Sexual/Violence) (Optional)
 ]
 outputType: String(FourSeverityLevels) (Optional)
 }

Response Body Schema

{
 categoriesAnalysis (Required): [
 (Required){
 category: String(Hate/SelfHarm/Sexual/Violence) (Required)
 severity: Integer (Optional)
 }
 ]
 }

Parameters:

options - The image analysis request.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

the image analysis response along with Response<T>.

analyzeText

public AnalyzeTextResult analyzeText(AnalyzeTextOptions options)

Analyze Text A synchronous API for the analysis of potentially harmful text content. Currently, it supports four categories: Hate, SelfHarm, Sexual, and Violence.

Parameters:

options - The text analysis request.

Returns:

the text analysis response.

analyzeText

public AnalyzeTextResult analyzeText(String text)

Analyze Text A synchronous API for the analysis of potentially harmful text content. Currently, it supports four categories: Hate, SelfHarm, Sexual, and Violence.

Parameters:

text - The text analysis request.

Returns:

the text analysis response.

analyzeTextWithResponse

public Response<BinaryData> analyzeTextWithResponse(BinaryData options, RequestOptions requestOptions)

Analyze Text A synchronous API for the analysis of potentially harmful text content. Currently, it supports four categories: Hate, SelfHarm, Sexual, and Violence.

Request Body Schema

{
 text: String (Required)
 categories (Optional): [
 String(Hate/SelfHarm/Sexual/Violence) (Optional)
 ]
 blocklistNames (Optional): [
 String (Optional)
 ]
 haltOnBlocklistHit: Boolean (Optional)
 outputType: String(FourSeverityLevels/EightSeverityLevels) (Optional)
 }

Response Body Schema

{
 blocklistsMatch (Optional): [
 (Optional){
 blocklistName: String (Required)
 blocklistItemId: String (Required)
 blocklistItemText: String (Required)
 }
 ]
 categoriesAnalysis (Required): [
 (Required){
 category: String(Hate/SelfHarm/Sexual/Violence) (Required)
 severity: Integer (Optional)
 }
 ]
 }

Parameters:

options - The text analysis request.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

the text analysis response along with Response<T>.

Applies to


Feedback

Was this page helpful?