From the blog post located here: Multiple Parallel AI Streams with the Vercel AI SDK
The app will stream two OpenAI API requests (one related to wather, another related to news) at the same time, and stream their content to two separate components on the page simultaneously.
- Clone the repo
- Install dependencies
npm install
# or
yarn install
# or
pnpm install
- Create a
.env.local
file in the root of the project and add the following:
OPENAI_API_KEY=your-openai-api-key
- Run the development server:
Open http://localhost:3000 with your browser to see the result.