Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/monalbarse/slift-api
Slift API shields your app from inappropriate language. Analyze text & flag messages in real-time. Easy integration, actionable insights. Keep your online space clean.
https://github.com/monalbarse/slift-api
api cloudflare-workers honojs typescript upstash-vector
Last synced: 11 days ago
JSON representation
Slift API shields your app from inappropriate language. Analyze text & flag messages in real-time. Easy integration, actionable insights. Keep your online space clean.
- Host: GitHub
- URL: https://github.com/monalbarse/slift-api
- Owner: MonalBarse
- License: apache-2.0
- Created: 2024-06-14T20:18:49.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-07-04T02:58:22.000Z (6 months ago)
- Last Synced: 2024-10-25T10:36:45.398Z (about 2 months ago)
- Topics: api, cloudflare-workers, honojs, typescript, upstash-vector
- Language: TypeScript
- Homepage: https://slift-api.monalbarse.workers.dev/
- Size: 52.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# Slift API
## Overview
Slift API offers a powerful text analysis service that swiftly identifies inappropriate language in textual messages. It provides a quick and efficient way to flag messages that may contain inappropriate content. Designed for easy integration, this API allows developers to quickly and effectively moderate user-generated content.
## Features
- **Content Analysis:** Detects and flags potentially inappropriate language, identifying specific words or phrases that triggered the detection.
- **Scoring System:** Provides a confidence score indicating the likelihood of sensitive content.## Tech Stack
- **Backend:** HonoJs for advanced text analysis capabilities
- **Database:** Upstash-Vector (Vector Database) for efficient data storage and retrieval
- **Deployment:** Cloudflare for scalable and efficient API hosting## Getting Started
1. **Clone the Repository:**
```bash
git clone https://github.com/MonalBarse/slift-api
```2. **Install Dependencies:**
```bash
cd slift-api
npm install
```3. **Run the Application:**
```bash
npm start
```Ensure you have a `.env` file in the root directory with the following configuration:
```bash
PORT=3000
API_KEY=your_api_key
NODE_ENV=production
```## Usage
To utilize the Slift API, send a POST request to the hosted endpoint.
### Endpoint
```
https://slift-api.monalbarse.workers.dev/
```### Request Payload
```json
{
"message": "What da ****"
}
```### Response Format
```json
{
"isProfane": true,
"score": 0.9,
"flaggedFor": "****"
}
```### Example Request
```bash
curl -X POST https://slift-api.monalbarse.workers.dev/ -H "Content-Type: application/json" -d '{"message": "What da ****"}'
```### Note:
- The `isProfane` field indicates whether the message contains inappropriate language.
- The `score` field provides a confidence level of the inappropriate content, ranging from 0 to 1.
- The `flaggedFor` field shows the specific word or phrase that triggered the detection.## Contributing
Feel free to contribute by:
- Reporting issues
- Adding new features
- Improving existing codeTo contribute:
1. Fork the repository.
2. Create a new branch (`git checkout -b feature-branch`).
3. Make your changes and commit them (`git commit -am "build:"`). Follow [these](https://github.com/conventional-changelog/commitlint/tree/master/@commitlint/config-conventional#type-enum) guidelines for any commit messages.
4. Push to the branch (`git push origin feature-branch`).
5. Create a new Pull Request.