I would like to know how to stop streaming create chat completion. According to the documentation of OpenAI Node API library ([OpenAI Node API Library]) it is necessary to do you can break from the loop or call stream.controller.abort()
But I have the impression that this doesn’t seem to work at all. He still continues to generate.
I’ve investigated, and seemingly you can’t make the AI model stop generating and billing. You can only close the connection and ignore the subscription of server-sent events.
This is related to how on ChatGPT when you click “Stop Generating” on a response which isn’t going the way you are hoping, edit your message, and save and submit you often get an error message saying something about not being able to send multiple messages at once.
I believe this was a bug and has now been fixed actually.
I genuinely would like to see this. I was under the impression that they would also close the connection as the server is notified when a client prematurely closes their subscription. I haven’t dug into this myself though.
I just tried it myself. Now have to wait ~5 minutes to see the billing.
Unfortunately not. It was just something that never occurred when I first starting using ChatGPT, then started happening, and now seems to have resolved.