ChatGPT API Recall Issue

Joined
Mar 19, 2022
Messages
38
Reaction score
14
I'm trying to make article creation software with ChatGPT API. But when I save previous conversations, I get an error like this:
This model's maximum context length is 4097 tokens. However, your messages resulted in 4154 tokens. Please reduce the length of the messages.
How do I overcome this error? Is there an alternative way to remind messages?
 
I'm trying to make article creation software with ChatGPT API. But when I save previous conversations, I get an error like this:

How do I overcome this error? Is there an alternative way to remind messages?

The error you are encountering with the ChatGPT API indicates that the maximum context length for the model is 4097 tokens, but the messages you are trying to save resulted in 4154 tokens. One way to overcome this error is to reduce the length of the messages by either removing unnecessary words or splitting the messages into smaller chunks.

Alternatively, you can use a different approach to save and recall previous conversations. One method is to store the conversation data in a database or a text file and retrieve it when needed. This way, you can easily manage the length of the messages and avoid the context length error.

You can also try using a different language model that allows for longer context lengths if reducing the length of messages is not feasible. However, this may require additional research and testing to find a suitable model for your needs.
 
The input is too big. In AI, size matters in reverse.
 
You will have to either shorten the input or get on the waitlist for gpt4-32k
 
Back
Top