-
Notifications
You must be signed in to change notification settings - Fork 60k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] 请求两次获取主题 #1668
Comments
看了下 是因为 app/client/platforms/openai.ts 中 let finished = false;
const finish = () => {
if (!finished) {
console.log("[OpenAI] request finished");
options.onFinish(responseText);
finished = true;
}
}; 这个 finish 在 onmessage 遇到 [DONE] 与通道被关闭时都会调用,但是两个时机很接近导致 第二次调用时,第一次的调用并没有执行到 finished = true的位置(猜测)导致了这一事件的发生,将 finished = true; 移到 options.onFinish(responseText);前面可以解决问题 |
@Yidadaa hi |
Yidadaa
added a commit
that referenced
this issue
May 22, 2023
jinker
pushed a commit
to jinker/ChatGPT-Next-Web
that referenced
this issue
Jun 19, 2023
Jeremy-Hibiki
pushed a commit
to Jeremy-Hibiki/ChatGPT-Next-Web
that referenced
this issue
Sep 5, 2023
Jeremy-Hibiki
pushed a commit
to Jeremy-Hibiki/ChatGPT-Next-Web
that referenced
this issue
Sep 5, 2023
gaogao1030
pushed a commit
to gaogao1030/ChatGPT-Next-Web
that referenced
this issue
May 16, 2024
gaogao1030
pushed a commit
to gaogao1030/ChatGPT-Next-Web
that referenced
this issue
May 16, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
最新版在首次对话后会进行两次获取主题的请求,导致tokens浪费
The text was updated successfully, but these errors were encountered: