A simple ChatGPT plugin for executing Jupyter notebooks. This demonstrates a working ChatGPT plugin with OAuth support using Auth0.
This is heavily inspired by dangermode. It could have been a fork, but the code is small enough that I started from scratch.
- Auth0 Account Created
- Auth0 Application Created
- Auth0 API Created (use
https://example.com/jupychat
as the identifier and audience) - Python 3.11+ installed
- Poetry installed
- Task installed
- ngrok installed
- Clone this repository
cp .env.example .env
- Fill out your auth0 details in
.env
task serve
- To use OAuth, you can't use localhost for the plugin. I recommend using ngrok.
ngrok http 8000
- Copy the ngrok URL and add it to your
.env
asdomain=...
- Restart your FastAPI server
- Copy the ngrok URL and paste it into the ChatGPT plugin UI
- Copy and paste your Auth0 Application's Client ID and Client Secret into the ChatGPT plugin UI
- Copy the verification token from the ChatGPT plugin UI and paste it into your
.env
likeopenai_verification_token=...
- Restart your FastAPI server
- Every time you change your
ai-plugin.json
, you need to recreate your plugin in ChatGPT- This means you'll get a new verification token too. You'll need to update your
.env
and restart your FastAPI server
- This means you'll get a new verification token too. You'll need to update your
- All kernel state is lost when your FastAPI server restarts. This is sort of a bug, it could be fixed by connecting to any kernels already running in the connections directory.
- The code getting generated by ChatGPT is mostly lost. It's only saved in the ChatGPT UI. Noteable's plugin writes changes back to your file and you can view it execute in real time.