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:
npm install
to install the required dependenciesnpx convex dev --once
to set up a Convex project- Sign up at OpenAI's Developer Platform.
- Go to OpenAI's dashboard and create an API KEY.
- Set the required OpenAI environment variable as
OPENAI_API_KEY
in the Convex dashboard 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.