-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GenerateText and useChat work as expected but streamText doesn't work at all! #3154
Comments
You are not importing |
Thx MrSir. I would not have seen this. You are correct, and I installed it. However, same problem still persists :( |
|
Try removing the code below from your try block as it's blocking the streaming response.
You can instead use |
Thanks, MrSir, you 100 % nailed it. It had nothing to do with the beautiful Vercel AI package, but it was due to Prisma. Putting the Prisma call in the onFinished callback fixed it 100%, and streaming is working like a charm.
|
Hi folks, can we use for streamText, am able to do someting like Note: am using Next.js app router. |
@arvindanta you can set use chat to text protocol, and then just return a response that contains the text. |
Description
Using
useChat
andstreamText
from"ai"
leads to a status ofpending
of the/api/chat API route
Here my package.json:
Code example
ChatComponent:
and API route:
in the network tab of my chrome browser I only see
pending
and then nothing happens. no Errors and nothing.Additional context
No response
The text was updated successfully, but these errors were encountered: