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 login
to login to your Cloudflare account in wrangler - Run
wrangler deploy
to publish the plugin to Cloudflare Workers
- You can configure the
.well-known/ai-plugin.json
route 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.ts
for an example.
Follow the instructions in the ChatGPT documentation to deploy your plugin and begin using it in ChatGPT.