Replies: 2 comments
-
|
I found that the examples were in fact for the pages directory. so it worked when I moved the code from the documentaion too pages/api and not app/api |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
This discussion was automatically locked because it has not been updated in over 30 days. If you still have questions about this topic, please ask us at community.vercel.com/ai-sdk |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I am trying to follow this example for setting up a streaming response for nextjs pages directory (with the route handler in the app folder). however the docs here seem to be out of date (they use the old signature with req and res object) https://sdk.vercel.ai/docs/guides/frameworks/nextjs-pages#nodejs-runtime but trying to port this to the new signature I am not sure where I would ahve to get the res from
I have tried several approaches but they all error e.g. :
I think the part that I am missing is how to construct this response object to pass to the
streamToResponseAny feedback would be highly appreciated! Thanks!
Beta Was this translation helpful? Give feedback.
All reactions