This project demonstrates a Chrome Extension, which uses the Built-in AI Prompt API to ask the model to explain a code block written in a programming language.
-
Install Chrome Canary and setup the browser for Built-in Chrome AI as per the instructions here.
-
Download the entire repository to a specific folder on your local machine.
-
In the browser location, enter
chrome://extensions
. -
We need to Load an unpacked extension, as per the instructions here. Simply click on
Load unpacked
, specify the root of the repository and you should be all set. -
Now visit any page, select a section of text from the page and then right-click and select the
Explain this code
action. This will display its analysis of the code block as shown below in the Chrome Extensions side panel.
A sample result in shown below.