GithubHelp home page GithubHelp logo

yuanjie-ai / chatgpt-prompt-splitter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jupediaz/chatgpt-prompt-splitter

1.0 0.0 0.0 2.75 MB

ChatGPT PROMPTs Splitter. Tool for safely process chunks of up to 15,000 characters per request

Home Page: https://chatgpt-prompt-splitter.jjdiaz.dev

License: MIT License

JavaScript 42.39% Python 57.31% Procfile 0.30%

chatgpt-prompt-splitter's Introduction

ChatGPT PROMPTs Splitter

ChatGPT PROMPTs Splitter

Deploy with Vercel

โ“ 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! ๐Ÿš€

Error Message Too Long

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:

  1. Divide the prompt into chunks based on the specified maximum length.

  2. 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.

Set Max 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.

Input Text

Step 3: Click "Split"

Click the "Split" button to process the text and divide it into smaller chunks.

Click Split

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.

Copy Chunks

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.

Paste Chunks

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

  1. Clone the repository:
git clone https://github.com/jupediaz/chatgpt-prompt-splitter.git
  1. Change to the project directory:
cd chatgpt-prompt-splitter
  1. Install the required dependencies:
pip install -r requirements.txt

Usage

Running the Flask application in development mode

  1. Run the Flask application:
vercel dev
  1. Open your web browser and navigate to http://localhost:3000.

Deploy the Flask application to production

  1. Deploy the Flask application:
vercel --prod
  1. 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:

  1. Make sure you have the required dependencies installed:
pip install -r requirements.txt
  1. 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

chatgpt-prompt-splitter's People

Contributors

jupediaz avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.