Welcome to Agent Shield! 🚀🤖 This repository houses an advanced AI agent designed to safeguard digital environments by detecting and categorizing harmful content, including hate speech and personal information. Agent Shield empowers developers to integrate robust content moderation capabilities into their applications, ensuring safer and more secure online interactions.
In today's interconnected world, maintaining a safe and respectful digital space is crucial. Agent Shield serves as your vigilant ally in this endeavor, leveraging state-of-the-art AI technologies to identify and categorize potentially harmful content with precision and efficiency. Whether you're developing a social media platform, chat application, or any online service, Agent Shield equips you with powerful tools to uphold community standards and user safety.
Before using the Agent Shield
project, you need to obtain:
- Google API Key: The Google API key is required for utilizing language models and AI services.
Obtain an API key from Google Cloud Console: https://console.cloud.google.com/apis/credentials. Once obtained, configure it in the
.env
file of Agent Shield.
Agent Shield is highly configurable. To set up your environment:
-
Clone this repository to your local machine:
git clone https://github.com/yourusername/agent-shield agent_shield
-
Navigate to the project directory:
cd agent_shield
-
Set up the
.env
file:-
Rename
.env.example
to.env
. -
Open
.env
and configure the following variables:GOOGLE_API_KEY=your-google-api-key-here
-
-
Save and close
.env
.
To start using Agent Shield, follow these steps:
For a streamlined setup using Docker:
-
Build and run the Docker containers:
docker-compose up -d --build
-
Access the API:
Open your browser and navigate to
http://localhost:7651
to access the Agent Shield API. -
Access the UI:
Open your browser and navigate to
http://localhost:7652
to access the Agent Shield UI.
-
Create a Virtual Environment: Set up a virtual environment to manage dependencies.
python -m venv .venv .venv\Scripts\activate
-
Install Poetry: Install Poetry to manage project dependencies.
pip install poetry
-
Install Dependencies: Install the project dependencies using Poetry.
poetry install
-
Install executable: Install the Agent Shield executable to run the AI agent.
pip install --editable .
-
Run the AI Agent:
Start the AI agent to handle content moderation queries.
-
Run the AI Agent: Start the AI agent to handle content moderation queries.
agent-shield ask "Is this a safe message?"
The AI agent will analyze the message and provide a content moderation decision.
agent-shield categories "HARM_CATEGORY_DEROGATORY" agent-shield categories 2
-
Utilize the API: Access the Agent Shield API for integrating content moderation into your applications.
agent-shield run api
The API will be accessible at
http://localhost:7651
by default. -
Run the UI: Optionally, run the Agent Shield UI for a graphical interface to interact with the AI agent.
agent-shield run ui
The UI will be available at
http://localhost:7652
in your browser.
-
Agent Shield is developed by Mohamad Aboud
. Explore more about the author and their projects on GitHub. 💻😊
We hope Agent Shield empowers you to create safer digital spaces! Happy moderating! 🛡️🌐