Vercel AI SDK
Unanswered
Transvaal lion posted this in #help-forum
Transvaal lionOP
Hey everyone, wondering if the new AI sdk is compatible with pages directory? Getting some issues and wondering if it only works with Next 13.
Specifically talking about the useCompletion() hook
Specifically talking about the useCompletion() hook
8 Replies
Black carp
Hey, it’s not directly related to your question but I think it would be helpful for you to know that Next 13 is not equal to using App Router or
app directory. You can still use the Pages Router or pages directory with Next 13, you can even use both at the same time as it was introduced with incremental adoption in mind.You may want to disassociate a little the router used (App or Pages) from the Next version, as they are different things
you need App Router streaming mechanism to get Vercel AI SDK work in Next.js
plus be aware node.js and v8 is single thread event loop so it chokes main thread without asynchronous calls
i mean Page is synonymous call
Transvaal lionOP
Cool, appracite the help guys
Chub mackerel
Yes it is compatible. They have a few example projects where they use it with app router.
If you look at YouTube channel you’ll find a few: YouTube.com/elie2222
If you look at YouTube channel you’ll find a few: YouTube.com/elie2222
Pip gall wasp
streaming functionality is compatible with app router