All OpenAI models (and other LLMs) have certain token limits, depending on the model, so you can't exceed the required token limit (or convert to characters if you want using
tokenizer).
An example is shown in the following from OpenAI documentation:
For GPT-3.5-turbo models:
https://platform.openai.com/docs/models/gpt-3-5-turbo
For GPT-4 models:
https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo
(The "context window" token limits in OpenAI models refers to the maximum number of tokens a model can process in a single request. For example, older GPT-3.5-turbo models have a 4K token limit for each request (with 512 tokens for output), shared between the prompt (input) and completion (output). There's also a separate output token limit stated for each model on their tables. Be informed of OpenAI latest changes as the tables may not be updated in real time. )
Refer here to learn more about tokens and how to count them:
what-are-tokens-and-how-to-count-them?
how_to_count_tokens_with_tiktoken?
Knowing the limitations, your only option to increase the characters is to choose a model with higher token limits.
I'm not an expert in GPT programming, but this information could help you understand what to do next.
The following are my suggestion on your simple project:
1. Adding a token counter in the input bar to warn you beforehand to avoid response cut-off
2. Your GPT should have a chat history list in memory so that it can save and use your old conversations
3. Though not a necessity, you can add a button with a pre-defined prompt like “Could you finish the example you gave in the <.......> paragraph of your previous response?” in cases where the response was cut off. Just an example!
These ideas might trigger some thoughts on your part.
I hope this helped.