chat-gpt-jupyter-extension  by jflam

Jupyter extension for interacting with ChatGPT in notebooks

created 2 years ago
266 stars

Top 96.9% on sourcepulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

This browser extension integrates ChatGPT directly into local Jupyter Notebooks, enabling users to generate and execute code interactively within their existing workflow. It's designed for data scientists, researchers, and developers who leverage Jupyter for experimentation and coding. The primary benefit is streamlining the process of getting code suggestions and examples from ChatGPT and immediately testing them in a notebook environment.

How It Works

The extension injects JavaScript into the Jupyter Notebook web page, acting as a privileged proxy. It reuses the bearer token from an established OpenAI ChatGPT login session to communicate with the service, bypassing the lack of an official API. Prompts are entered into markdown cells prefixed with ##### chat. Upon pressing Shift+Enter, the extension extracts the prompt, infers the programming language, and sends it to ChatGPT along with relevant prior code cells from the same thread as context. Responses containing code are parsed and placed into separate, executable Jupyter code cells.

Quick Start & Requirements

  • Installation:
    • Chrome/Edge (Local Install): Download build.zip from Releases, unzip, and drag the folder onto the extensions page (chrome://extensions or edge://extensions) with Developer Mode enabled.
    • Build from Source: Clone the repo, install dependencies with npm, and run ./build.sh.
  • Prerequisites: Requires an existing OpenAI ChatGPT login session. Works with the classic Jupyter Notebook UI.
  • Links: Releases

Highlighted Details

  • Enables interactive code generation and execution directly within Jupyter Notebooks.
  • Supports conversational context (threads) by including previous code cells in prompts.
  • Automatically detects programming languages for syntax highlighting in generated code cells.
  • Allows editing of generated code cells, with changes sent back to ChatGPT in subsequent queries.

Maintenance & Community

  • The project is inspired by and was forked from WangDàpéng/chat-gpt-google-extension.
  • No specific community links (Discord/Slack) or roadmap are mentioned in the README.

Licensing & Compatibility

  • The license is not explicitly stated in the provided README text.

Limitations & Caveats

  • Only supports the classic Jupyter Notebook user interface; compatibility with JupyterLab is not provided.
  • The extension requires manual installation via browser extension management or building from source.
  • The README mentions potential issues with ChatGPT's code generation accuracy and the need for manual code correction.
Health Check
Last commit

2 years ago

Responsiveness

1+ week

Pull Requests (30d)
0
Issues (30d)
0
Star History
0 stars in the last 90 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems) and Carol Willing Carol Willing(Core Contributor to CPython, Jupyter).

genai by rgbkrk

0%
352
IPython extension for generative AI assistance in Jupyter notebooks
created 3 years ago
updated 1 year ago
Feedback? Help us improve.