“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.
title: tone_generator | app_file: openrouter_web_tonegenerator.py | sdk: gradio | sdk_version: 5.22.0
This repository contains three implementations of chatbots using the OpenRouter API:
- Command-line Chatbot (
openrouter_chatbot.py
) - Web Interface Chatbot (
openrouter_web_chatbot.py
) - 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).
-
Install dependencies:
pip install -r requirements.txt
-
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
- Create a
Run the command-line interface:
python openrouter_chatbot.py
Type your messages and press Enter. Type 'exit' to quit.
Run the web interface:
python openrouter_web_chatbot.py
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.
- 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
You can adjust the following settings in the code:
MAX_REQUESTS_PER_MINUTE
: Change the rate limitMODEL
: Select a different model from OpenRoutertemperature
and other generation parameters in the API request
MIT