chatgpt-plugin-template-deno
chatgpt-plugin-template-deno copied to clipboard
Template for building ChatGPT Plugins in TypeScript that run on Supabase's custom Deno Edge Runtime.
ChatGPT Plugin Template with Supabase Edge Runtime
Template for building ChatGPT Plugins in TypeScript that run on Supabase Edge Runtime.
For a full walk through, read the blog post: Building ChatGPT Plugins with Supabase Edge Runtime.
Or watch the video tutorial:
Note: This is a TypeScript port of OpenAI's official "[...] simple todo list plugin with no auth" Python example.
Generate OpenAPI spec
The chatgpt-plugin
function contains @openapi
JSDoc annotations which are used for swagger-jsdoc
to generate the openapi.json
file
deno run --allow-read --allow-write scripts/generate-openapi-spec.ts
Run locally
- Build and start the container:
docker compose up --build
- Visit
- http://localhost:8000/chatgpt-plugin
- http://localhost:8000/.well-known/ai-plugin.json
- http://localhost:8000/chatgpt-plugin/openapi.json
- http://localhost:8000/chatgpt-plugin/todos/user
File changes in the /functions
directory will automatically be detected, except for the /main/index.ts
function as it is a long running server.
Deploy to Fly.io
- Clone this repository.
- Change
http://localhost:8000
to your Fly domain in the/main/ai-plugins.json
file - Open
fly.toml
and update the app name and optionally the region etc. - In your terminal, run
fly apps create
and specify the app name you just set in yourfly.toml
file. - Finally, run
fly deploy
.
Install the Plugin in the ChatGPT UI
- Select the plugin model from the top drop down, then select “Plugins”, “Plugin Store”, and finally “Install an unverified plugin” or “Develop your own plugin”.
- Either enter
localhost:8000
or your Fly domain and click "Find manifest file"