4 ms·
they are using Server Side Events (SSE) to stream the text. see API docs: https://platform.openai.com/docs/api-reference/chat/create https://platform.openai.co
by qqqturing2 4y ago
they are using Server Side Events (SSE) to stream the text.
see API docs: https://platform.openai.com/docs/api-reference/chat/create https://platform.openai.com/docs/api-reference/chat/create
> If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. See the OpenAI Cookbook for example code.
- czx4f4bd 4y agoInteresting. Apparently server-sent events show up in devtools under the network tab as multiple responses sent for the same request. https://firefox-source-docs.mozilla.org/devtools-user/network_monitor/inspecting_server-sent_events/index.html https://firefox-source-docs.mozilla.org/devtools-user/networ... https://stackoverflow.com/a/46075339/6417784 https://stackoverflow.com/a/46075339/6417784