Skip to content

Commit b34a1ba

Browse files
committed
fix: Streaming examples
1 parent 9f67360 commit b34a1ba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ The client supports streaming responses for real-time processing. Here are examp
4444
#### Using Async Iterator
4545

4646
```typescript
47-
const stream = await ai21.chat.completions.create({
47+
const streamResponse = await ai21.chat.completions.create({
4848
model: 'jamba-1.5-mini',
4949
messages: [{ role: 'user', content: 'Write a story about a space cat' }],
5050
stream: true,
5151
});
5252

53-
for await (const chunk of stream) {
53+
for await (const chunk of streamResponse) {
5454
console.log(chunk.choices[0]?.delta?.content || '');
5555
}
5656
```

0 commit comments

Comments
 (0)