Skip to content

Commit

Permalink
Rebuilt using native Side Panel (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgzsh269 authored Dec 31, 2023
1 parent 9804b8b commit e3caeed
Show file tree
Hide file tree
Showing 62 changed files with 3,698 additions and 1,607 deletions.
36 changes: 29 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,54 @@

**NOTE**: This AI-powered extension is under active development, please verify the results as necessary and provide feedback to help us improve.

Webgati AI is a Chrome extension for interactive web browsing. Whether you're researching, studying, or just exploring diverse content, Webgati AI is designed to efficiently guide you through webpages by providing quick summaries and answers directly from the content.
Webgati AI is a Chrome & MS Edge browser extension for chatting with any webpage. Whether you're researching, studying, or just exploring diverse content, Webgati AI is designed to efficiently guide you through webpages by providing quick summaries and answers directly from the content.

### Features

- Interactive Sidebar: Open a chat by clicking the extension icon, ask questions or seek summaries from any webpage effortlessly.

- Content Selection Dialog: Highlight text, and a dialog box will pop up to allow direct interaction with the content.

- Privacy-Focused: Direct integration with OpenAI API without storing user data ensures your interactions remain private and secure.
- Vision chat: Easily ask questions about the visual information on the page (images, graphs, etc.) by using the extension to take a screenshot or select an area of the page.

- Privacy-Focused:
- Use private local models via [Ollama](#ollama-setup) for complete privacy
- OR use your own API key to access cloud-based model providers, your chat is directly sent to their API, not to any other server, thus ensuring your data remains private and secure. (Currently OpenAI and Anthropic are supported, more model providers will be available soon, reach out for any specific model request)

- Open Source: Community-driven and transparent, allowing for continuous improvement and collective auditing.

## DEMO
### Demo
<a href="https://www.youtube.com/watch?v=jtVr1JYI18Q" target="_blank"><img src="https://img.youtube.com/vi/jtVr1JYI18Q/0.jpg" alt="Demo Video"></a>


### Roadmap

[Watch the demo](https://www.youtube.com/watch?v=OHT9CDmEctI)
- Save chat messages to local storage
- Custom prompts/instructions for each website
- Index and chat with all pages in a website
- Add more model providers including multi-lingual and domain-specific models
- Web agents for automated tasks

## Ollama Setup

- Install [Ollama](https://ollama.ai/)
- Run `OLLAMA_ORIGINS=* OLLAMA_HOST=127.0.0.1:11434 ollama serve`

## Local Setup

- `npm install`
- `npm run dev`
- `npm run build:dev` (Hot reloading with `npm run dev` will not work due to WASM dependencies needed for in-memory models via `transformers.js`)
- Load the extension from `dist` folder using `Load unpacked` option in Chrome extensions ([instructions](https://developer.chrome.com/docs/extensions/mv3/getstarted/development-basics/#load-unpacked))

## Tech/Frameworks

- Chrome extension - [CRXJS](https://crxjs.dev/vite-plugin/)
- AI/LLM - [LangChain](https://github.com/langchain-ai/langchainjs)
- AI/LLM - [LangChain](https://github.com/langchain-ai/langchainjs), [transformers.js](https://huggingface.co/docs/transformers.js/index)
- UI - [Mantine](https://mantine.dev/)

## Contributing
This project is open to and encourages contributions to benefit the wider community! Feel free to reach out to get started.

## Feedback

Please provide feedback by creating an issue or sending an email to [email protected]
Please provide feedback by creating an issue, sending an email to [email protected] or contacting [sqzsh269](https://twitter.com/sgzsh269)
1 change: 1 addition & 0 deletions docs/CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
webgatiai.com
11 changes: 11 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Github Pages - redirect to repo root -->
<!DOCTYPE html>
<html>
<head>
<meta
http-equiv="refresh"
content="0; url=https://github.com/sgzsh269/webgati-ai"
/>
</head>
<body></body>
</html>
21 changes: 12 additions & 9 deletions manifest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ const { version } = packageJson;
const [major, minor, patch] = version.replace(/[^\d.-]+/g, "").split(/[.-]/);

const icons = {
"16": "icon.png",
"32": "icon.png",
"48": "icon.png",
"128": "icon.png",
"16": "public/icon.png",
"32": "public/icon.png",
"48": "public/icon.png",
"128": "public/icon.png",
};

export default defineManifest(async (env) => ({
Expand All @@ -28,10 +28,10 @@ export default defineManifest(async (env) => ({
default_icon: icons,
default_title: APP_NAME,
},
options_page: "settings.html",
options_page: "public/settings.html",
content_scripts: [
{
js: ["src/chatbot/index.tsx"],
js: ["src/content-script/index.tsx"],
matches: ["http://*/*", "https://*/*"],
},
],
Expand All @@ -40,11 +40,14 @@ export default defineManifest(async (env) => ({
type: "module",
persistent: false,
},

permissions: ["activeTab", "storage", "tabs"],
content_security_policy: {
extension_pages: "script-src 'self' 'wasm-unsafe-eval'",
},
host_permissions: ["<all_urls>"],
permissions: ["activeTab", "storage", "tabs", "sidePanel"],
web_accessible_resources: [
{
resources: ["settings.html"],
resources: ["public/settings.html"],
matches: ["http://*/*", "https://*/*"],
},
],
Expand Down
Loading

0 comments on commit e3caeed

Please sign in to comment.