-
-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Labels
bugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is needed
Description
The stream-text is not returning content in chunks as expected β instead, it returns everything all at once at the end.
No such issue in v0.2.2
Reproduction
import { streamText } from '@xsai/stream-text'
import { env } from 'node:process'
export default defineEventHandler(async (event) => {
const { content } = await readValidatedBody(
event,
z.object({
content: z.string(),
}).parse,
)
const { textStream } = await streamText({
apiKey: env.OPENAI_API_KEY!,
baseURL: env.OPENAI_BASE_URL!,
messages: [
{ role: 'system', content: AVeryLongContent },
{ role: 'user', content },
],
model: 'deepseek-chat',
response_format: { type: 'json_object' },
})
for await (const textPart of textStream) {
console.log(textPart)
}
// return textStream
})Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is needed