❓ Have you ever received a message from ChatGPT about sending too much data and needing to send a shorter text?
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.
You can read the full article on Medium: ChatGPT PROMPTs Splitter: Split long text prompts into smaller chunks for ChatGPT
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.
- 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
Follow these simple steps to use the ChatGPT Prompt Splitter web application, illustrated with screenshots.
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.
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.
Click the "Split" button to process the text and divide it into smaller 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.
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.
- Python 3.x
- Flask
- 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
- Run the Flask application:
vercel dev
- Open your web browser and navigate to http://localhost:3000.
- Deploy the Flask application:
vercel --prod
- Open your web browser and navigate to https://chatgpt-prompt-splitter.jjdiaz.dev/.
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.
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please read the CONTRIBUTING file for details on how to contribute to the project.
If you have any questions or suggestions, please contact me at hello@jjdiaz.dev.
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.
- Initial release