Purpose
ChatGPT for Jupyter is a browser extension that provides a variety of AI-assisted features in Jupyter Notebooks and Jupyter Lab, powered by ChatGPT or GPT-4.
Main Capabilities
The extension provides the following main features (all performed by ChatGPT/GPT-4):
- Format: Automatically add comments, docstrings, and formatting to code cells.
- Explain: Explain the contents of a code cell in ELI5 (Explain Like I'm Five) style.
- Debug: Help debug error messages in code cells.
- Complete: Help complete code snippets in code cells.
- Review: Perform a code review on code cells.
- Ask a question: Ask ChatGPT a custom question.
- Voice command: Ask ChatGPT a custom question via microphone. Note: This feature requires an OpenAI API key and uses the OpenAI Whisper API, which costs $0.006 per minute. The above Ask a question and Voice command features are still work-in-progress.
How to Use
Installation methods include:
- Install to Chrome/Edge: You can install via the Chrome Web Store link, or download chromium.zip from Releases, unzip it, enable Developer mode on the Chrome/Edge extensions page (chrome://extensions or edge://extensions), drag the unzipped folder into the page to import it (do not delete the folder afterward).
- Install to Firefox: Download firefox.zip from Releases, open about:debugging, click "This Firefox" in the sidebar, click the "Load Temporary Add-on" button, then select any file in the unzipped folder.
- Build from source: Use npm to install dependencies, then load the build/chromium/ or build/firefox/ directory into the browser.
Applicable Scenarios
Suitable for writing, understanding, debugging, and reviewing code in Jupyter Notebook and Jupyter Lab, with the help of ChatGPT/GPT-4.
Limitations and Notes
- Project status: Stable, but under frequent development. If you encounter issues or have feature suggestions, you can submit an issue.
- Important update: In September 2023, this repository was archived. The author cannot continue maintaining it due to a new role, and recommends using an alternative:https://github.com/jupyterlab/jupyter-ai。
- ChatGPT is not perfect and will make mistakes. You cannot rely on it blindly; the following situations may occur: modifying code in unexpected ways, generating code that cannot run, providing incorrect explanations and misinterpretations, and incorrectly marking correct code as incorrect.
- In many cases, trying several times and choosing the result you like best will produce better results. ChatGPT may be able to do what you want, but it may not give the correct result the first time.
- Voice command requires an OpenAI API key and is billed according to the Whisper API ($0.006 per minute).
- Outstanding items & Future plans include: adding Jupyter Lab support, refactoring prompt engineering, adding copy-paste functionality and/or automatic addition, adding an interrupt button, and adding integration tests.
Acknowledgments
- ChatGPT/GPT-4 did all the heavy lifting.
- wong2/chat-gpt-google-extension served as the original foundation for this extension.