ChatGPT PROMPTs Splitter
β Have you ever received a message from ChatGPT about sending too much data and needing to send a shorter text?
Here's a great alternative to bypass this limitation! π
Overview
ChatGPT PROMPTs Splitter is an open-source tool designed to help you split long text prompts into smaller chunks, making them suitable for usage with ChatGPT (or other language models with character limitations).
The tool ensures that the text is divided into safe chunks of up to 15,000 characters per request as default, although can be changed.
The project includes an easy-to-use web interface for inputting the long text, selecting the maximum length of each chunk, and copying the chunks individually to paste them to ChatGPT.
Post on Medium
You can read the full article on Medium: ChatGPT PROMPTs Splitter: Split long text prompts into smaller chunks for ChatGPT
How it works
The tool uses a simple algorithm to split the text into smaller chunks. The algorithm is based on the following rules:
-
Divide the prompt into chunks based on the specified maximum length.
-
Add information to the first chunk to instruct the AI on the process of receiving and acknowledging the chunks, and to wait for the completion of chunk transmission before processing subsequent requests.
Features
- Python 3.9
- Web interface for splitting text into smaller chunks
- Customizable maximum length for each chunk
- Copy chunks individually to send to ChatGPT
- Instructions for ChatGPT on how to process the chunks
- Tests included
- Easy deployment to Vercel included
Usage example
Follow these simple steps to use the ChatGPT Prompt Splitter web application, illustrated with screenshots.
Step 1: Access the application
Open your web browser and navigate to the application URL.
https://chatgpt-prompt-splitter.jjdiaz.dev/
You should see the main screen, displaying the input fields for your long text prompt and maximum chunk length.
Step 2: Input the long prompt
Enter the text you want to split into smaller chunks for use with ChatGPT.
You can also specify custom length for each chunk by entering the number of characters in the "Max chars length..." field.
In this example, we are gonna split into chunks of just 25 characters.
Step 3: Click "Split"
Click the "Split" button to process the text and divide it into smaller chunks.
Step 4: Copy the chunks
The application will display the text divided into smaller chunks. You can copy each chunk individually by clicking the "Copy" button next to it.
Step 5: Paste the chunks into ChatGPT
Now that you have your chunks copied, you can paste them into ChatGPT or any other language model with character limitations.
That's it! You've successfully split a long PROMPT into smaller, manageable chunks using the ChatGPT Prompt Splitter.
Getting Started
Prerequisites
- Python 3.x
- Flask
Installation
- Clone the repository:
git clone https://github.com/jupediaz/chatgpt-prompt-splitter.git
- Change to the project directory:
cd chatgpt-prompt-splitter
- Install the required dependencies:
pip install -r requirements.txt
Usage
Running the Flask application in development mode
- Run the Flask application:
vercel dev
- Open your web browser and navigate to http://localhost:3000.
Deploy the Flask application to production
- Deploy the Flask application:
vercel --prod
- Open your web browser and navigate to https://chatgpt-prompt-splitter.jjdiaz.dev/.
Running Tests
This project includes a suite of unit tests to ensure the proper functionality of the tool. To run the tests, follow these steps:
- Make sure you have the required dependencies installed:
pip install -r requirements.txt
- Run the tests using the unittest module:
python3 -m unittest discover tests
The test suite will run, and the results will be displayed in the terminal.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please read the CONTRIBUTING file for details on how to contribute to the project.
Contact
If you have any questions or suggestions, please contact me at [email protected].
Disclaimer
This project is not affiliated with OpenAI, Microsoft, or any other entity. The project is provided "as is" without warranty of any kind, express or implied. The author is not responsible for any damages or losses arising from the use of this project.
Changelog
1.0.0
- Initial release