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

先向大佬致敬,然后想问下能否添加会话保留和新会话功能; #2

Open
SuniceTop opened this issue Mar 17, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@SuniceTop
Copy link

自己改了下用localstorage存的,不知道有没有其他更好的方式~

@lianginx lianginx added the enhancement New feature or request label Mar 17, 2023
@lianginx
Copy link
Owner

谢谢,过奖了

我也是打算用 localStorage 存储,好像暂时没有比这更方便的方法了。

另外还有一种方法,是把所有信息编码成 Base64 文本放到 URL 参数中储存,参考:如何在 URL 存储状态

@lianginx
Copy link
Owner

lianginx commented Apr 7, 2023

我用 Nuxt 框架做了一个新项目,可以很方便的在服务端调用 API 然后将结果转发到客户端,最近支持了多会话和本地保留聊天记录功能(有待完善),如果你有兴趣,可以查看这个项目 chatgpt-nuxt

@lianginx
Copy link
Owner

lianginx commented Apr 7, 2023

我用 Nuxt 框架做了一个新项目,可以很方便的在服务端调用 API 然后将结果转发到客户端,最近支持了多会话和本地保留聊天记录功能(有待完善),如果你有兴趣,可以查看这个项目 chatgpt-nuxt

我在这个项目中使用本地数据库 indexedDB 来保存所有信息,相比 localStoreage 更灵活,可以像数据库一样方便的查询和筛选

@humbass
Copy link

humbass commented Apr 12, 2023

弄个数据库支持不就行了 , sqlite ,electron 支持的还可以

@lianginx
Copy link
Owner

弄个数据库支持不就行了 , sqlite ,electron 支持的还可以

如果是在线服务,我不想在服务端存储任何数据,只提供 Web 页面和接口调用就行了。每个用户的聊天记录和 API Key 都保留在他们自己的浏览器中,不用担心隐私泄漏的问题,服务器也不用承担数据储存的成本了。

如果使用 Electron 做成本地应用,到是可以找一个顺手的数据库(indexedDB真的很难用),但精力有限,目前主要在做 chatgpt-nuxt,基本功能都差不多了

@kodakjerec
Copy link

參考大老的應用.延伸localstorage儲存, 做輕量級應用. 另外加入了儲存對話, 謝謝大老
kodakjerec/chatgpt-vue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants