This is a Next.js chat template for GenSX with streaming chat, thinking, and tools built in. It also includes chat history stored using @gensx/storage.
To get started, first install the dependencies:
pnpm installThen export the environment variables. For this template, you'll need both the OpenAI API key and the Firecrawl API key:
export OPENAI_API_KEY=...
export FIRECRAWL_API_KEY=...pnpm run devThis will start both the Next.js app as well as the local GenSX dev server. The app will be available at http://localhost:3000 and the GenSX dev server will be available at http://localhost:1337.
To deploy the GenSX workflows, run:
pnpm run deployThe easiest way to deploy your Next.js app is to use Vercel.
Once you deploy, make sure to set the following environment variables so the app can access the GenSX workflows:
export GENSX_API_KEY=...
export GENSX_ORG=...
export GENSX_PROJECT=chat-tools
export GENSX_ENV=default