Template repository for a generative UI app, powered by C1 by Thesys, and bootstrapped with create-next-app
First, generate a new API key from Thesys Console and then set it your environment variable.
export THESYS_API_KEY=<your-api-key>Install dependencies:
npm iThen, run the development server:
npm run devOpen http://localhost:3000 with your browser to see the result.
You can start editing your responses by modifying the system prompt in src/app/api/chat/route.ts.
This template includes a GitHub Action that automatically verifies the C1 model used in src/app/api/ask/route.ts is valid according to the Thesys API. This workflow runs on every pull request to ensure you're using a supported model.
To enable this workflow in your repository:
- Go to your repository's Settings → Secrets and variables → Actions
- Add a new repository secret named
THESYS_API_KEYwith your Thesys API key value - The workflow will now run automatically on all pull requests
The workflow will:
- Extract the model name from
src/app/api/ask/route.ts - Fetch the list of valid models from the Thesys API
- Verify that your model is in the list of supported models
- Block the PR from merging if an invalid model is detected
You can view available models by running the verification script locally:
THESYS_API_KEY=<your-api-key> .github/scripts/verify-model.shTo require this check to pass before merging PRs:
- Go to your repository's Settings → Branches
- Add or edit a branch protection rule for your main branch (e.g.,
mainormaster) - Enable Require status checks to pass before merging
- Search for and select Verify C1 Model in the status checks list
- Save the protection rule
This ensures that only valid C1 models can be merged into your main branch.
To learn more about Thesys C1, take a look at the C1 Documentation - learn about Thesys C1.