feat: add smooth stream (#722)

This commit is contained in:
Jeremy 2025-01-23 01:53:41 +05:30 committed by GitHub
parent 3f9d379a6a
commit 5e8cddc886
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 52 additions and 20 deletions

View file

@ -2,6 +2,7 @@ import { generateUUID } from '@/lib/utils';
import {
DataStreamWriter,
experimental_generateImage,
smoothStream,
streamObject,
streamText,
tool,
@ -60,6 +61,7 @@ export const createDocument = ({
model: customModel(model.apiIdentifier),
system:
'Write about the given topic. Markdown is supported. Use headings wherever appropriate.',
experimental_transform: smoothStream({ chunking: 'word' }),
prompt: title,
});