Skip to content

Commit a3a2716

Browse files
committed
👌 IMPROVE: Examples lingo
1 parent 9e1f8f5 commit a3a2716

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

examples/nextjs/components/langbase/generate-text.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export default function GenerateTextExample() {
7373

7474
{!loading && completion && (
7575
<p className="mt-4">
76-
<strong>Completion:</strong> {completion}
76+
<strong>Generated completion:</strong> {completion}
7777
</p>
7878
)}
7979
</div>

examples/nextjs/components/langbase/stream-text.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
import {Button} from '@/components/ui/button';
44
import {Input} from '@/components/ui/input';
5+
import {fromReadableStream} from 'langbase';
56
import {useState} from 'react';
6-
// import {fromReadableStream} from 'langbase';
7-
import {fromReadableStream} from '../../../../packages/langbase/src/lib/browser/stream';
7+
// import {fromReadableStream} from '../../../../packages/langbase/src/lib/browser/stream';
88

99
export default function StreamTextExample() {
1010
const [prompt, setPrompt] = useState('');
@@ -27,11 +27,9 @@ export default function StreamTextExample() {
2727

2828
if (response.body) {
2929
const stream = fromReadableStream(response.body);
30-
console.log('✨ ~ stream:', stream);
3130

3231
// Method #1 to get all of the chunk.
3332
for await (const chunk of stream) {
34-
console.log('✨ ~ chunk:', chunk);
3533
const content = chunk?.choices[0]?.delta?.content;
3634
content && setCompletion(prev => prev + content);
3735
}

0 commit comments

Comments
 (0)