Skip to content

Latest commit

 

History

History
16 lines (11 loc) · 1.04 KB

README.md

File metadata and controls

16 lines (11 loc) · 1.04 KB

Vercel AI SDK, Next.js, and OpenAI Chat Example -- with Convex!

This is taken from this example which shows how to use the Vercel AI SDK with Next.js and OpenAI to create a ChatGPT-like AI-powered streaming chat bot.

This has been adapted to use Convex to power the chat bot.

To run the example locally you need to:

  1. npm install to install the required dependencies
  2. npx convex dev --once to set up a Convex project
  3. Sign up at OpenAI's Developer Platform.
  4. Go to OpenAI's dashboard and create an API KEY.
  5. Set the required OpenAI environment variable as OPENAI_API_KEY in the Convex dashboard
  6. npm dev to launch the app.

There is also an example of this same chat bot using Hono with Convex HTTP actions on the hono-convex branch.