DEV Community

Cover image for ChatGPT Prompt splitting
Dom Sipowicz
Dom Sipowicz

Posted on

ChatGPT Prompt splitting

  • How to overcome ChatGPT too long message limit?
  • how to easily split long texts for better ChatGPT results?

The message you submitted was too long, please reload the conversation and submit something shorter.


Here is the video explaining the whole concept of text chunking with an easy to use UI tools to try out:


Opensource repo:

GitHub logo jupediaz / chatgpt-prompt-splitter

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

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…


For a fully automated solution without manually splitting, the chat bot example from here can be taken, and this approach can be taken further and implemented as a starting point (pre-generated messages):

export const initialMessages: ChatGPTMessage[] = [
  {
    role: 'assistant',
    content: 'Hi! I am a friendly AI assistant. Ask me anything!',
  },
  {
    role: 'user',
    content: 'Do not answer yet. This is just another part of the text I want to send you. Just receive and acknowledge as Remember not answering yet. Just acknowledge you received this part with the message "Part 1/n received" and wait for the next part.',
  },
  {
    role: 'assistant',
    content: 'Part 1/n received.',
  },
]
Enter fullscreen mode Exit fullscreen mode

Godspeed

PS. Follow me on Twitter or LinkedIn
https://twitter.com/dom_sipowicz
https://www.linkedin.com/in/dominiksipowicz/

Top comments (0)