skills.vishalvoidskills/vishalvoid
Technical & DevelopmentIntermediate

azure-ai-contentsafety-java

Content moderation and safety

Developer Setup

Setup & Installation

bash
npx skills add https://github.com/microsoft/skills --skill azure-ai-contentsafety-java

Overview

What This Skill Does

Java SDK for Azure AI Content Safety. Provides APIs to analyze text and images for harmful content across four categories: hate, sexual, violence, and self-harm. Also supports custom blocklists for domain-specific term filtering.

Application

When to use this Skill

Documentation

Show Skills.md file

Azure AI Content Safety SDK for Java

Build content moderation applications using the Azure AI Content Safety SDK for Java.

Installation

<dependency>
    <groupId>com.azure</groupId>
    <artifactId>azure-ai-contentsafety</artifactId>
    <version>1.1.0-beta.1</version>
</dependency>

Client Creation

With API Key

import com.azure.ai.contentsafety.ContentSafetyClient;
import com.azure.ai.contentsafety.ContentSafetyClientBuilder;
import com.azure.ai.contentsafety.BlocklistClient;
import com.azure.ai.contentsafety.BlocklistClientBuilder;
import com.azure.core.credential.KeyCredential;

String endpoint = System.getenv("CONTENT_SAFETY_ENDPOINT");
String key = System.getenv("CONTENT_SAFETY_KEY");

ContentSafetyClient contentSafetyClient = new ContentSafetyClientBuilder()
    .credential(new KeyCredential(key))
    .endpoint(endpoint)
    .buildClient();

BlocklistClient blocklistClient = new BlocklistClientBuilder()
    .credential(new KeyCredential(key))
    .endpoint(endpoint)
    .buildClient();
Lines 1 - 38 of 287

Recommendations

Explore other random skills

All skillsMy patterns