Next.js Discord

Discord Forum

Unable to stream api data from vercel ai

Unanswered
Ankit posted this in #help-forum
Open in Discord
Avatar
AnkitOP
I am trying to integrate vercel ai in my /pages app. According to the the vercel ai docs, streaming response is not supported in /pages instead we can store the ui in /pages and use the api from /app
The Next.js Pages Router's API Routes do not support streaming responses. You can use the pages/ directory for the frontend while using an app/ directory Route Handler for handling your LLM responses with streaming.



But even after using the /app api route i dont get a streamed respose. Any idea how can i either debug or tackle it?

nextjs version: 13.5.5

0 Replies