How to migrate off of `format:'aisdk'` with custom Next route?
We have a next.js app with an embedded mastra instance.
We have a custom
I'm following the upgrade guide here
it says:
When I follow that link it says to use
example given:
This looks like nice DX if you're deploying a standalone mastra server, but does this even work if I'm embedding mastra into my next app?
Is there an equivalent way (as before) that I can use aisdk in my own api route?
We have a custom
/api/chat that performs a bunch of business logic before streaming the response.I'm following the upgrade guide here
it says:
The format: "aisdk" option in stream()/generate() methods is deprecated. Use the @mastra/ai-sdk package instead. Learn more in the Using Vercel AI SDK documentation.
When I follow that link it says to use
chatRoute() which "automatically formats the agent stream into an AI SDK-compatible format". example given:
This looks like nice DX if you're deploying a standalone mastra server, but does this even work if I'm embedding mastra into my next app?
Is there an equivalent way (as before) that I can use aisdk in my own api route?