A simple and elegant desktop application that processes text input using OpenAI's API and customizable prompt templates. Built with Python and Tkinter, featuring a modern user interface with typewriter animations and loading indicators.
- Clean and intuitive user interface
- Real-time text processing using OpenAI's API
- Customizable prompt templates
- Typewriter-style response animation
- Loading indicator during API calls
- Keyboard shortcuts (Enter to submit)
- Python 3.6+
- OpenAI API access
- Required Python packages (see
requirements.txt
)
- Clone the repository:
git clone [repository-url]
cd prompt_templater
- Create and activate a virtual environment:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Create a
.env
file with your API configuration:
API_KEY=your_openai_api_key
BASE_URL=your_api_base_url
MODEL=your_preferred_model
- Start the application:
python app.py
- Enter your text in the input box
- Press Enter or click Submit to process
- Watch as the response is typed out character by character
Templates are stored in the templates
directory. You can modify existing templates or create new ones to customize the prompts sent to the API.
prompt_templater/
├── app.py # Main application code
├── templates/ # Prompt template directory
│ └── rhymes.txt # Example template
├── requirements.txt # Python dependencies
└── .env # API configuration
Run the tests using:
python -m unittest discover tests
The test suite includes:
- Unit tests for app initialization
- Input validation tests
- API integration tests (with mocked responses)
- Template loading tests
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.