We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1520780 commit 5731e9cCopy full SHA for 5731e9c
src/content/docs/workers/examples/openai-sdk-streaming.mdx
@@ -43,12 +43,12 @@ export default {
43
const stream = await openai.chat.completions.create({
44
model: 'gpt-4o-mini',
45
messages: [{ role: 'user', content: 'Tell me a story' }],
46
- stream: true,
+ stream: true,
47
});
48
49
// loop over the data as it is streamed and write to the writeable
50
for await (const part of stream) {
51
- writer.write(textEncoder.encode(part.choices[0]?.delta?.content || ''));
+ writer.write(textEncoder.encode(part.choices[0]?.delta?.content || ''));
52
}
53
writer.close();
54
})());
0 commit comments