Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for stuff QA using context in active tab #190

Merged
merged 1 commit into from
Sep 7, 2023

Conversation

sudeepag
Copy link
Contributor

@sudeepag sudeepag commented Sep 1, 2023

This PR adds support for stuff QA using the context in the active tab. Note that this currently only works with the local server usage.

The example below shows a sample usage of chatting with the LLM using the contents of the active tab, which contains an AI-generated story.

Screencast.from.09-01-2023.10.24.20.AM.webm

@sudeepag sudeepag requested a review from tqchen September 1, 2023 14:31
@sudeepag
Copy link
Contributor Author

sudeepag commented Sep 7, 2023

@tqchen please let me know if I should make any changes or if it is good to merge, thanks!

@tqchen tqchen merged commit dae9ed9 into mlc-ai:main Sep 7, 2023
tqchen pushed a commit that referenced this pull request Feb 13, 2024
)

- Chrome has added WebGPU support in Service Worker in this
[commit](https://chromium-review.googlesource.com/c/chromium/src/+/5190750).
This example shows how we can create a Chrome extension using WebGPU and
service worker.
The project structure is as follows:
- `manifest.json`: A required file that lists important information
about the structure and behavior of that extension. Here we are using
manifest V3.
    - `popup.ts`: Script of the extension pop-up window.
- `background.ts`: Script of the service worker. An extension service
worker is loaded when it is needed, and unloaded when it goes dormant.
    - `content.js`: Content script that interacts with DOM.
- To run the extension, first make sure you are on [Google Chrome
Canary](https://www.google.com/chrome/canary/).
- In Chrome Canary, go to
`chrome://flags/#enable-experimental-web-platform-features` and enable
the `#enable-experimental-web-platform-features` flag. **Relaunch the
browser**.
- Run
  ```bash
  npm install
  npm run build
  ```

This will create a new directory at `./dist/`. To load the extension
into Chrome, go to Extensions > Manage Extensions and select Load
Unpacked. Add the `./dist/` directory. You can now pin the extension to
your toolbar and use it to chat with your favorite model!

**Note**: This example disables chatting using the contents of the
active tab by default.
To enable it, set `useContext` in `popup.ts` to `true`. More info about
this feature can be found
[here](#190). 
However, if the web content is too large, it might run into issues. We
recommend using `example.html` to
test this feature.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants