-
Notifications
You must be signed in to change notification settings - Fork 757
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
Clear auto-generated conversations #17
Comments
Edit:
Actually, I have implemented this functionality, but it has to be active in the background in order to trigger, and many browsers do not allow extensions to keep active in the background, so it often fails to clean up correctly. And it's difficult to predict when users don't need a session, and providing a button for users to click and delete is sometimes inconvenient, as many people may forget to click it. And continuing to use the same session can lead to context issues and slow response time. Currently, I suggest using this method: wong2/chatgpt-google-extension#301 (comment). 其实目前我做了这个功能, 但是必须是后台活跃, 才能触发, 而许多浏览器不允许插件后台一直保持活动, 所以很多时候没能正确清理 目前我建议你可以用此方法: wong2/chatgpt-google-extension#301 (comment) async function getToken() {
const session = await (await fetch('https://chat.openai.com/api/auth/session')).json();
return session.accessToken;
}
var TOKEN = await getToken();
async function getConversations() {
return (await (await fetch('https://chat.openai.com/backend-api/conversations?offset=0&limit=100', { headers: {'authorization': `Bearer ${TOKEN}`} })).json()).items;
}
async function deleteConversation(id) {
const response = await fetch(`https://chat.openai.com/backend-api/conversation/${id}`, {
method: 'PATCH',
headers: {
'authorization': `Bearer ${TOKEN}`,
'content-type': 'application/json',
},
body: JSON.stringify({"is_visible": false}),
})
return await response.json();
}
conversations = await getConversations();
toClear = conversations.filter(c => c.title === 'New chat')
await Promise.allSettled(toClear.map(c => deleteConversation(c.id))) |
好吧,也许完美的解决方法是切换成api方式233 |
Now it is possible to automatically clear conversations, and you can turn it on/off in advanced settings |
Is your feature request related to a problem? Please describe.
新功能是否与解决某个问题相关, 请描述
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
希望每次执行之后能自动删除会话,目前每查询一次,翻译一次就会在列表里留下一个新会话,得自己一个一个删除
A clear and concise description of what you want to happen.
Additional context
其他
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: