Giter VIP home page Giter VIP logo

halt-ai's Introduction

Halt.AI

One stop solution for organizations to manage the use of Generative AI chatbots like Gemini and ChatGPT by their employees.

Installation

System Requirements:

Python 3.12.0

NodeJS v21.7.2

Clone the project using the GitUrl

git clone <git-url>

Installing the requirements for the backend.

cd backend

Use the package manager pip to install necessary requirements.

pip install -r requirements.txt

Now we will configure ngrok to create an https URL for our backend so that chrome extension could make API requests to it. Chrome does not allow to make requests to http based local host servers for security reasons. SignUp on the ngrok website at https://ngrok.com/ and replace the <auth-token> by the auth token provided by website in the following command.

ngrok config add-authtoken <auth-token>

In a new terminal with base directory as the project folder, run the following command to create an https secured URL using ngrok which will be used in the frontend to make the requests to the backend.

./ngrok.exe http http://127.0.0.1:8000

Before Initialization, we need to create and configure the following .env file inside the <PROJECT_FOLDER>\backend\backend folder.

GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_KEY=

FACEBOOK_CLIENT_ID=
FACEBOOK_CLIENT_SECRET=

CLOUDINARY_CLOUD_NAME=
CLOUDINARY_API_KEY=
CLOUDINARY_API_SECRET=

API_KEY_XXX=GEMINI_API_KEY

Now we can setup the database by following commands.

python ./manage.py makemigrations
python ./manage.py migrate

To Create a super user, use the following command and set email and password accordingly which will be used to log into the admin dashboard.

python ./manage.py createsuperuser

Now we can successfully start the backend server

python ./manage.py runserver

Installing the requirements for the frontend.

In a new terminal, change directory to the extension folder using following command:

cd halt-ai

Install the necessary packages to build the extension using the command:

npm install -g pnpm
pnpm install

Now open the file <PROJECT_FOLDER>\halt-ai\src\utils\handler.ts in any code editor of preference and replace the variable value for this.BASE_URL = '<ngrok-url-for-backend>'. Now we will compile the extension using the command:

pnpm build

This will create us a build of extension which could be installed inside the chrome extensions.

Usage

Usage of the Extension by Employee

Now go to Manage Chrome Extension page and turn on the Developer Mode

Click on the Load unpacked option and select the following folder <PROJECT_FOLDER>\halt-ai\build\chrome-mv3-prod

Now go to the options panel of the extension by using right click on the extension on the top right and clicking on the options tab.

This will show a window to Login using the Employee ID. Type in the ID of the Employee. This will be used for logging in the administration panel.

Using the extension on ChatGPT or Gemini

The extension automatically activates when the user visits the following Generative AI Chatbots. User will just have to write the query and press Enter to start the checking process, if the query is safe, the extension will automatically pass the request to the chatbots to proceed and if not safe then will not allow the request and show the error on the screen of the user.

Usage of Admin Panel by the Administrator

Admin can visit the administration panel by using the following link in the browser:

https://127.0.0.1:8000/admin

Testing

The testing folder contains Jupyter Notebook testing.ipynb which was used to test the API with 113 different queries stored in the Book1.xlsx file inside the folder.

Query

For any query, feel free to react out to Siddharth Agrawal on [email protected]

halt-ai's People

Contributors

siddharth329 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.