This example shows you how to use our handlers and add custom code to support more advanced logic.
This example uses OpenAssistantGPT SDK, Vercel AI SDK, Next.js and OpenAI to create a ChatGPT-like AI-powered streaming chat bot.
Deploy the example using Vercel:
Execute create-next-app
with npm, Yarn, or pnpm to bootstrap the example:
npx create-next-app --example https://github.com/OpenAssistantGPT/OpenAssistantGPT-SDK/tree/main/examples/website-custom-api next-openassistantgpt-app
yarn create next-app --example https://github.com/OpenAssistantGPT/OpenAssistantGPT-SDK/tree/main/examples/website-custom-api next-openassistantgpt-app
pnpm create next-app --example https://github.com/OpenAssistantGPT/OpenAssistantGPT-SDK/tree/main/examples/website-custom-api next-openassistantgpt-app
To run the example locally you need to:
- Sign up at OpenAI's Developer Platform.
- Go to OpenAI's dashboard and create an API KEY.
- Set the required OpenAI environment variable as the token value as shown the example env file but in a new file called
.env.local
pnpm install
to install the required dependencies.pnpm dev
to launch the development server.
To learn more about OpenAssistantGPT take a look at the following resources: