This is an example plugin showing how to build ChatGPT plugins using Cloudflare Workers. Using this example, you can deploy a plugin to Cloudflare Workers in just a few minutes.
The sample plugin allows ChatGPT users to search for repositories using GitHub's search API. The plugin is implemented in TypeScript and uses the OpenAPI specification to define the plugin's API.
- Sign up for Cloudflare Workers. The free tier is more than enough for most use cases.
- Install wrangler, the Cloudflare Workers CLI
- Clone this project and install dependencies with
npm install - Run
wrangler loginto login to your Cloudflare account in wrangler - Run
wrangler publishto publish the plugin to Cloudflare Workers
- You can configure the
.well-known/ai-plugin.jsonroute inindex.ts. - Update the OpenAPI schema in
openapi.ts. - You can set up any new routes and the associated OpenAPI schema by defining new routes. See
search.tsfor an example.
Follow the instructions in the ChatGPT documentation to deploy your plugin and begin using it in ChatGPT.
