Giter Site home page Giter Site logo

michaelyuhe / ai-group-tabs Goto Github PK

View Code? Open in Web Editor NEW
941.0 7.0 83.0 2.01 MB

Organize and group your Chrome tabs with AI

License: MIT License

HTML 0.75% TypeScript 97.03% JavaScript 1.88% CSS 0.22% Shell 0.13%
chrome-extension tabs-management chrome react

ai-group-tabs's Introduction

ai-group-tabs's People

Contributors

chia1104 avatar eltociear avatar hgaogao avatar hqwuzhaoyi avatar hyoban avatar jt-wang avatar lawvs avatar michaelyuhe avatar neerajkumarc avatar nohzafk avatar observedobserver avatar ringozzt avatar skyf0cker avatar zouhangwithsweet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ai-group-tabs's Issues

Click 'Group Existing Tabs' yields no response;

Description

checking the Chrome extensions reveals an error prompt.

Error log

Error in event handler: TypeError: Cannot read properties of undefined (reading '0') at chrome-extension://gnclkpnopkmphjkajnolljlogjmoglec/service_worker.js:1:313 at Array.forEach (<anonymous>) at chrome-extension://gnclkpnopkmphjkajnolljlogjmoglec/service_worker.js:1:295
TypeError: Cannot read properties of undefined (reading '0')
import{g as s}from"./utils.fb-KO4Ve.js";async function f(n,e,r){const o=n.map(t=>({id:t.id,title:t.title,url:t.url})),a=e.map(t=>({type:t,tabIds:[]})),i=await s("model")||"gpt-4",c=await s("apiURL")||"https://api.openai.com";try{return await Promise.all(o.map(async t=>{if(!t.url)return;const p=(await(await fetch(`${c}/v1/chat/completions`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`},body:JSON.stringify({messages:[{role:"system",content:"You are a classificator"},{role:"user",content:`Based on the URL ${t.url}, classify the browser tab type as one of the following: ${e.join(", ")}. Respond with only the classification keyword from the list.`}],model:i})})).json()).choices[0].message.content,l=e.indexOf(p);l!==-1&&a[l].tabIds.push(t.id)})),a}catch(t){return console.error(t),a}}async function u(n,e,r){try{const o=await s("model")||"gpt-4",a=await s("apiURL")||"https://api.openai.com";return(await(await fetch(`${a}/v1/chat/completions`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`},body:JSON.stringify({messages:[{role:"system",content:"You are a classificator"},{role:"user",content:`Based on the URL ${n.url}, classify the browser tab type as one of the following: ${e.join(", ")}. Respond with only the classification keyword from the list.`}],model:o})})).json()).choices[0].message.content}catch(o){console.error(o)}}export{f as b,u as h};

Sync with groups created manually

We can create a group manually by right-clicking on the tab. But the extension doesn't record that group now

  • Add a new type for new group created manually
  • Record in tabGroupMap
  • Merge group if there is already a group with that type

分组效果不好

用的release的最新版本。

  1. 不会自动分组
  2. 需要多刷新几次
  3. 不会自动学习,根域名一致时不会自动合并
  4. 即使域名一致,不同path也不会自动合并
  5. 标签页里右键添加的分组,在扩展插件里不展示,不知道是这两块本来就有区别吗?

不知道是不是我使用姿势不对,都是需要手动添加分组里。

Use GPT3.5 by default instead of GPT4

I think GPT3.5 turbo is sufficent for such task, GPT4 is much more expensive than GPT3.5 turbo (maybe 10x to 30x).

Use GPT3.5 turbo by default is better.

Cannot be used normally on brave

It doesn't work at all. When you open a new tab, it's still a different color. For example, the BBC, CNN, etc. have been classified as news, but news like Bloomberg is still a different color.

TypeError in Event Handler on Chrome Extension Post-Update

After a recent update, I encountered the following error in a Chrome extension:
Error in event handler: TypeError: Cannot read properties of undefined (reading '0') at chrome-extension://mjfblbggcgffnijgopjiocacoajgnjak/service_worker.js:1:277 at Array.forEach (<anonymous>) at chrome-extension://mjfblbggcgffnijgopjiocacoajgnjak/service_worker.js:1:259

Enhancement of AI Grouping Accuracy and User Experience

Dear MichaelYuhe and Contributors,

I hope this message finds you well. I've been exploring the AI Group Tabs extension and I must commend the innovative approach to tab management. The use of AI to categorise and group tabs is a significant step forward in browser organisation.

However, I would like to suggest a couple of enhancements that could potentially elevate the user experience and the extension's functionality:

  1. AI Grouping Accuracy: While the default categories are quite useful, there are instances where tabs could be more accurately grouped with additional context. Perhaps implementing a feature that allows the AI to learn from user corrections could improve accuracy over time. This could be in the form of a feedback loop where the user can indicate the correct group for a tab, and the AI adapts accordingly.

  2. User Experience: The current process for customising categories is straightforward, yet it might benefit from a more intuitive interface. For example, a drag-and-drop functionality for organising categories and tabs within the popup could make the customisation process more user-friendly.

  3. Performance Optimisation: As more tabs are opened and grouped, there might be a noticeable impact on performance. It would be beneficial to conduct a thorough performance analysis to ensure that the extension scales well with heavy usage.

  4. Accessibility Features: Consider adding features that make the extension more accessible to a wider range of users, such as keyboard navigation support and high-contrast themes for those with visual impairments.

I believe these suggestions align with the roadmap's focus on improving the extension and could be considered for future releases. Additionally, I'm curious about the progress on the CI/CD implementation for build and release, as it's a crucial step for streamlined updates and maintenance.

Thank you for your dedication to this project. I'm looking forward to the upcoming features and improvements.

Best regards,
yihong1120

Feature: Customize colors for types

Now we use default colors with Chrome API, it might be better to let user decide which color to use for a specified type.

Maybe we can add a color picker between the "type inputbar" and the "delete button"
image

Extenstion doesn't work

I've pasted my OpenAI Key and Opened many different tabs. When I press button "Group Existing Tabs" the button shows throbber (loading icon) about 1 second and then nothing happens at all.

Extenstion: AI Group Tabs ver. 1.0.2 downloaded from Chrome Web Store
Browser: Google Chrome ver. 109.0.5414.120
OS: Windows 7

1111

22222

404 not found

填完key之后点validate,没有反应,提示:
POST https://api.openai.com/v1/engines/davinci/completions 404 (Not Found)
我是从插件商店下载的,请问该如何解决?

Add config for API Server

Can you add a configuration for the API Server address? So that we can use some third-party OpenAI API proxy services.

[feature request]: support for ollama self-hosted llm

After a few test, i found that using the open source model like mistral 7B can also do this job well. By support these self-hosted model, users don't need to worry about the networking issues related to connecting to OpenAI's network and the potential costs associated with using the models.

image image

分组后的效果不是很好

比如,我打开了几个视频页面,但是都自己一组
image
我的设置,如图(模型用的GPT 3.5 turbo):
image

Unable to automatically name groups

Environment

  1. Browser: Thorium version 116.0.5845.169 (Official version) (arm64)
  2. Extension version: Latest version
  3. Confirmed that the OpenAI key is working fine
  4. Some Group types have been initially set up

Specific Issue

Try closing the browser, then reopening it and visiting some websites to check if the functionality is working properly. The extension only automatically divides each tab into individual unnamed groups for me, but according to the Surge Dashboard, network requests appear to be successful.

第一次使用的时候报错

1
2
import{g as r}from"./utils.Xiu07ssm.js";async function m(n,e,o){const a=n.map(t=>({id:t.id,title:t.title,url:t.url})),s=e.map(t=>({type:t,tabIds:[]})),i=await r("model")||"gpt-3.5-turbo",c=await r("apiURL")||"https://api.openai.com/v1/chat/completions";try{return await Promise.all(a.map(async t=>{if(!t.url)return;const p=(await(await fetch(c,{method:"POST",headers:{"Content-Type":"application/json",Authorization:Bearer ${o},"Api-Key":o},body:JSON.stringify({messages:[{role:"system",content:"You are a classificator"},{role:"user",content:Based on the URL: "${t.url}" and title: "${t.title}", classify the browser tab type as one of the following: ${e.join(", ")}. Respond with only the classification keyword from the list.}],model:i})})).json()).choices[0].message.content,l=e.indexOf(p);l!==-1&&s[l].tabIds.push(t.id)})),s}catch(t){return console.error(t),s}}async function f(n,e,o){try{const a=await r("model")||"gpt-3.5-turbo",s=await r("apiURL")||"https://api.openai.com/v1/chat/completions";return(await(await fetch(s,{method:"POST",headers:{"Content-Type":"application/json",Authorization:Bearer ${o},"Api-Key":o},body:JSON.stringify({messages:[{role:"system",content:"You are a classificator"},{role:"user",content:Based on the URL: "${n.url}" and title: "${n.title}", classify the browser tab type as one of the following: ${e.join(", ")}. Respond with only the classification keyword from the list.}],model:a})})).json()).choices[0].message.content}catch(a){console.error(a)}}export{m as b,f as h};

无法在brave进行标签排序

完全不起作用,打开新标签还是不同的颜色.比如已经对bbc,cnn等归类为news但是彭博社等新闻还是不同的颜色

[feature request]: Add caching for request results

  • It is recommended to implement caching for request results, avoiding the need to send requests every time. This is particularly beneficial when dealing with a large number of tags, as it prevents fetching all tags with each grouping.
  • Adopting this approach ensures that user actions are not overwritten, providing a safeguard for their interactions.
  • Consider offering an option to re-sort all tags (Maybe not, because Ungroup All can already achieve the goal)

[feature request]: 将相同的域名合并到一个标签

大多数情况下同一个域名下的页面内容方向是相似的,得到的标签也应该是相同的
短时间内打开同一域名下的多个页面也是常见的事情
是不是可以将同一域名的所有页面作为一个整体来获取标签,来避免因为识别错误导致的标签页位置跳动

使用基于本地计算的实现

动机

当前使用 ChatGPT 的实现存在诸多问题,典型的问题如下:

  • 可用性问题,由于众所周知的原因,OpenAI 的 API 可能在诸多国家和地区有可用性问题,甚至用户网络也极大地影响体验。
  • 隐私性问题,浏览记录的重要性不言而喻,甚至很多 url 中包含了很多隐私数据,诸如密钥等,当前的解决方案中,可能无法保证用户的隐私问题,很多对隐私极端注重的用户可能因此会弃用。
  • 高门槛问题,OpenAI 的 API KEY 对诸多用户来说依旧是一个较高的门槛,甚至在某些国家和地区,无法注册订阅等等,提供中心的服务又会带来服务器成本,Token 成本,隐私性问题等等。

综上所述,使用基于本地推理的实现变得很合理,能极大的提升体验,和用户群。

挑战

基于本地推理计算的实现也存在一些挑战,例如,训练难度,成本,数据集等问题,本地推理带来的性能开销,以及做为一个浏览器插件本身的桎梏,我本人是一个客户端和后端开发者,对机器学习了解不深,做了简单地调研之后,可能 Bert 等是个可行的选择,欢迎继续讨论其他方案,仅做抛砖引玉。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.