https://github.com/natgluons/ai-tone-generator
An AI-powered tone generator that transforms text into various tones using the Deepseek V3 model via OpenRouter, deployed to Hugging Face Spaces
https://github.com/natgluons/ai-tone-generator
chatbot chatbot-application deepseek-v3 gradio huggingface huggingface-spaces language-learning-model llm openrouter openrouter-api text-generator tonegenerator
Last synced: about 2 months ago
JSON representation
An AI-powered tone generator that transforms text into various tones using the Deepseek V3 model via OpenRouter, deployed to Hugging Face Spaces
- Host: GitHub
- URL: https://github.com/natgluons/ai-tone-generator
- Owner: natgluons
- Created: 2025-03-24T15:05:45.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2025-03-24T15:44:15.000Z (2 months ago)
- Last Synced: 2025-03-24T16:37:43.736Z (2 months ago)
- Topics: chatbot, chatbot-application, deepseek-v3, gradio, huggingface, huggingface-spaces, language-learning-model, llm, openrouter, openrouter-api, text-generator, tonegenerator
- Language: Python
- Homepage: https://huggingface.co/spaces/natgluons/tone_generator
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## ✨ Ever overthink a simple message?
### You know... rereading it five times, wondering:
> “Does this sound too cold?”> “Too formal?”
> “Too *me*?”
Welcome to the social anxiety zone. 😬Whether you're texting a crush, replying to your boss, or just rewording that "Hey, just checking in" for the seventh time —
🎉 Meet your new messaging buddy: **the AI Tone Generator**.It tweaks your words, smooths your vibe, and makes sure your tone hits just right — every time.
## **Stop second-guessing. Start sounding *exactly* how you want!** 💬💫

## Try It Out!
### [Try this AI tone generator RIGHT HERE! 🎭](https://huggingface.co/spaces/natgluons/tone_generator)
## Snapshots of the app in action
### Be friendly! :)

### Be casual~

### Be... playful?

### Or choose to be whatever you want!

### Example prompt provided
### Have fun! ✨
---
# OpenRouter Chatbot Implementations
#### title: tone_generator | app_file: openrouter_web_tonegenerator.py | sdk: gradio | sdk_version: 5.22.0This repository contains three implementations of chatbots using the OpenRouter API:
1. **Command-line Chatbot** (`openrouter_chatbot.py`)
2. **Web Interface Chatbot** (`openrouter_web_chatbot.py`)
3. **Web Interface AI Tone Generator** (`openrouter_web_tonegenerator.py`)All implementations use the Deepseek V3 model through OpenRouter and include **rate limiting** to keep things fun and **fair**! (though let's normalize not hogging random people's API, please! We're all broke).
## Setup
1. **Install dependencies**:
```
pip install -r requirements.txt
```2. **Set up environment variables**:
- Create a `.env` file in the project root with:
```
OPENROUTER_API_KEY=your_api_key_here
```
- Alternatively, set this environment variable through your system's settings## Usage
### Command-line Chatbot
Run the command-line interface:
```
python openrouter_chatbot.py
```Type your messages and press Enter. Type 'exit' to quit.
### Web Interface Chatbot
Run the web interface:
```
python openrouter_web_chatbot.py
```### Web Interface AI Tone Generator
Run the web interface:
```
python openrouter_web_tonegenerator.py
```This will start a local Gradio web server. Open the displayed URL in your browser to interact with the chatbot.
## Features
- **Rate Limiting**: Both implementations limit requests to 10 per minute and 100 per day by default
- **Response Cleanup**: Formats AI responses to be well-structured and complete
- **Chat History**: The web interface retains conversation history
- **Error Handling**: Graceful handling of API errors and timeouts## Configuration
You can adjust the following settings in the code:
- `MAX_REQUESTS_PER_MINUTE`: Change the rate limit
- `MODEL`: Select a different model from OpenRouter
- `temperature` and other generation parameters in the API request## License
MIT