Skip to content

Latest commit

 

History

History
71 lines (54 loc) · 3.53 KB

File metadata and controls

71 lines (54 loc) · 3.53 KB
page_type languages products urlFragment
sample
java
azure
azure-cognitive-services
azure-ai-content-safety
ai-contentsafety-samples

Azure AI Content Safety Samples client library for Java

This document explains samples and how to use them.

Examples

Following section document various examples.

Create Content Safety Client Sample

  • CreateContentSafetyClient.java - Contains samples for following scenarios:
    • Authenticate client by Key Credential
    • Authenticate client by Token Credential

Analyze Text Sample

  • AnalyzeText.java - Contains samples for following scenarios:
    • Authenticate client
    • Analyze text

Analyze Image Samples

  • AnalyzeImage.java - Contains samples for following scenarios:
    • Authenticate client
    • Analyze image

Manage text blocklist Samples

  • ManageTextBlocklist.java - Contains samples for following scenarios:
    • Authenticate client
    • Create or update text blocklist
    • Add blockItems
    • Analyze text with blocklists
    • List text blocklists
    • Get text blocklist
    • List blockItems
    • Get blockItem
    • Remove blockItems
    • Delete text blocklist

Troubleshooting

General

Error Code Possible reasons Suggestions
InvalidRequestBody One or more fields in the request body do not match the API definition. 1. Check the API version you specified in the API call.
2. Check the corresponding API definition for the API version you selected.
InvalidResourceName The resource name you specified in the URL does not meet the requirements, like the blocklist name, blocklist term ID, etc. 1. Check the API version you specified in the API call.
2. Check whether the given name has invalid characters according to the API definition.
ResourceNotFound The resource you specified in the URL may not exist, like the blocklist name. 1. Check the API version you specified in the API call.
2. Double check the existence of the resource specified in the URL.
InternalError Some unexpected situations on the server side have been triggered. 1. You may want to retry a few times after a small period and see it the issue happens again.
2. Contact Azure Support if this issue persists.
ServerBusy The server side cannot process the request temporarily. 1. You may want to retry a few times after a small period and see it the issue happens again.
2.Contact Azure Support if this issue persists.
TooManyRequests The current RPS has exceeded the quota for your current SKU. 1. Check the pricing table to understand the RPS quota.
2.Contact Azure Support if you need more QPS.