node-chatgpt-api icon indicating copy to clipboard operation
node-chatgpt-api copied to clipboard

The problem after a long conversation

Open ayxj0 opened this issue 2 years ago • 3 comments

After a very long conversation, I found this error. Is there any way to solve this problem now? Or is this the limit? 1

ayxj0 avatar Apr 09 '23 17:04 ayxj0

Same as me. It seems like some kind of limitations.

BoringFunk avatar Apr 10 '23 14:04 BoringFunk

There's a TODO in BingAIClient. Need to count the tokens and remove older messages. Are you able to check how many tokens the conversation used before that error occurred?

waylaidwanderer avatar Apr 14 '23 02:04 waylaidwanderer

There's a TODO in BingAIClient. Need to count the tokens and remove older messages. Are you able to check how many tokens the conversation used before that error occurred?

Yes. I now clearly know that when the total number of words I chat exceeds 20,000 Chinese characters, there will be an error. Since a Chinese character generally occupies two tokens, I think there will be an error when it exceeds 40,000 tokens. This problem is easy to reproduce. You send an article with about 40,000 words at once, and I think it will definitely report an error.

ayxj0 avatar Apr 14 '23 04:04 ayxj0