Azure Content Safety Service - Python SDK

 

https://www.pexels.com/photo/inflatable-ring-on-post-during-nighttime-681275/
https://www.pexels.com/photo/inflatable-ring-on-post-during-nighttime-681275/

In this blog, we will explore how to set up and run a Python application that utilizes Azure Content Safety services. The application will analyze text input for content safety and provide feedback based on the analysis.

Prerequisites

Before we begin, ensure you have the following installed on your system:

  1. Python 3.13 or higher
  2. git clone this repository, https://github.com/dennisseah/azure-content-safety
  3. follow the setup instructions in the README.md to set up the project environment.
  4. Create an Azure Content Safety resource and obtain the necessary API keys.

Running the Application

To run the application, use the following command in your terminal:

uv run python -m main "<your text here>"
task main -- "<your text here>"

Replace `<your text here>` with the text you want to analyze for content safety.

Here is a short demo (without audio)






Comments