Skip to content

Example of how to create multiple parallel AI streams with the Vercel AI SDK. From the linked blog post.

Notifications You must be signed in to change notification settings

mcavaliere/vercel-ai-sdk-parallel-streams

Repository files navigation

Streaming content in parallel with the Vercel AI SDK

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.

Installation

  1. Clone the repo
  2. Install dependencies
npm install
# or
yarn install
# or
pnpm install
  1. Create a .env.local file in the root of the project and add the following:
OPENAI_API_KEY=your-openai-api-key
  1. Run the development server:

Open http://localhost:3000 with your browser to see the result.

About

Example of how to create multiple parallel AI streams with the Vercel AI SDK. From the linked blog post.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published