Closed inannan423 closed 1 year ago
The problem has been resolved. There was an error in the code above the API request, which triggered the recompilation of Next.js and the reinitialization of ChatGPTAPI. Consequently, the conversation was forgotten. If you encounter similar issues, please consider troubleshooting the following two aspects:
Verify latest release
chatgpt
releaseVerify webapp is working
Environment details
Describe the Bug
I integrated ChatGPT into my own Next.js application, and everything was working fine yesterday. However, when I ran my program today, I found that ChatGPT no longer supports context! In the second round of dialogue, it prompts me "I'm sorry your question lacks context and I can't properly understand what it refers to. Please provide more information for a more accurate answer.", and the same is true for the next few rounds. And I'm pretty sure I successfully passed the parentMessageId to the chatgpt API before the second round of conversation. Please see the logs below.
I have tried multiple times, but the issue persists. I haven't found any information about this on the internet. As you can see in the code below, I first created a 'chat' request in the API route of Next.js to redirect the request to ChatGPT. The parentMessageId is not set for the first conversation, but it is set to the ID of the previous conversation for subsequent ones.
Since the issue occurred suddenly, I suspect it might be a bug. I would greatly appreciate it if you could take a look at this problem.
(By the way, I'm using Cloudflare's worker service to redirect the ChatGPT API service because ChatGPT is inaccessible in some countries. Could that be the issue?)