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-appyarn create next-app --example https://github.com/OpenAssistantGPT/OpenAssistantGPT-SDK/tree/main/examples/website-custom-api next-openassistantgpt-apppnpm create next-app --example https://github.com/OpenAssistantGPT/OpenAssistantGPT-SDK/tree/main/examples/website-custom-api next-openassistantgpt-appTo 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 installto install the required dependencies.pnpm devto launch the development server.
To learn more about OpenAssistantGPT take a look at the following resources: