/chatgpt-plugin-template-deno

Template for building ChatGPT Plugins in TypeScript that run on Supabase's custom Deno Edge Runtime.

Primary LanguageTypeScript

ChatGPT Plugin Template Deno

Template for building ChatGPT Plugins in TypeScript that run on Supabase's custom Deno Edge Runtime.

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

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 your fly.toml file.
  • Finally, run fly deploy.

Install the Plugin in the ChatGPT UI

  1. 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”.
  2. Either enter localhost:8000 or your Fly domain and click "Find manifest file"