Use Utility Types To Extract a Promise's Result
You asked, I answered:
Here's how to stream 'next question suggestions' using the AI SDK.
Get ready for your feed to be full of production-ready patterns like this. https://t.co/8URFeqIgII
Matt Pocockx.com
A very useful trick with OpenAI Functions to coerce the model to always return structured JSON:
Create a function called `print` that is called with the typed parameters of the actual you want to be generated and describe it such that it is always executed. Then grab what you need from the returned arguments payload.

Here's a production-ready pattern for adding 'suggested next questions' to any AI app with the AI SDK.
Want to see inside these functions? Check out the thread below. https://t.co/EBaN5OBqVc