{"id":13641069,"url":"https://github.com/pierxuy/chatgpt-assistant","last_synced_at":"2025-04-05T07:03:46.698Z","repository":{"id":153143555,"uuid":"628208846","full_name":"PierXuY/ChatGPT-Assistant","owner":"PierXuY","description":"基于Streamlit搭建的ChatGPT对话助手","archived":false,"fork":false,"pushed_at":"2024-07-22T02:08:52.000Z","size":1428,"stargazers_count":244,"open_issues_count":0,"forks_count":222,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T07:03:37.408Z","etag":null,"topics":["academic","chatgpt","chatgpt-api","prompt","streamlit","voice"],"latest_commit_sha":null,"homepage":"https://pearxuy-gpt.streamlit.app","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PierXuY.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-15T08:29:42.000Z","updated_at":"2025-04-01T17:37:20.000Z","dependencies_parsed_at":"2024-06-02T06:35:54.516Z","dependency_job_id":"5512d2c8-6705-45c6-a121-6e6f17ae9fba","html_url":"https://github.com/PierXuY/ChatGPT-Assistant","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PierXuY%2FChatGPT-Assistant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PierXuY%2FChatGPT-Assistant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PierXuY%2FChatGPT-Assistant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PierXuY%2FChatGPT-Assistant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PierXuY","download_url":"https://codeload.github.com/PierXuY/ChatGPT-Assistant/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247299831,"owners_count":20916190,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["academic","chatgpt","chatgpt-api","prompt","streamlit","voice"],"created_at":"2024-08-02T01:01:17.461Z","updated_at":"2025-04-05T07:03:46.671Z","avatar_url":"https://github.com/PierXuY.png","language":"Python","funding_links":[],"categories":["Prompts"],"sub_categories":[],"readme":"# 🤖 ChatGPT-Assistant\n基于Streamlit搭建的ChatGPT对话助手，简单易用，不易断连，支持以下功能：\n- 多聊天窗口\n- 历史对话留存\n- 预设聊天上下文 \n- 模型参数调节\n- 对话导出为Markdown文件\n- ChatGPT语音交流（推荐电脑端Edge浏览器）\n## 🤩 [已部署项目](https://pearxuy-gpt.streamlit.app/)\n- 直接使用已部署项目，可在网页的设置选项中配置Openai Key，此时不会留存历史对话，仅在用户当前会话有效，他人不会共享。\n- 自行部署项目，在Secrets中配置Openai Key后，将留存历史对话记录，此时需设置为私人应用，打造为个人GPT助理。   \n\n### 使用技巧：\n- 双击页面或按下/键可直接定位输入栏\n- Ctrl + Enter 可快捷提交问题\n\n### 注意事项：\n- 请勿使用streamlit==1.28.0版本，存在无限rerun的bug\n\n# 部署\n\n## Streamlit Cloud部署（推荐）\n轻松免费部署，且无须科学上网即可使用，注意设置为私人应用。   \n可参考由[@Hannah11111](https://github.com/Hannah11111)提供的[详细步骤](https://github.com/PierXuY/ChatGPT-Assistant/blob/main/Tutorial.md)。\n1. `Fork`本项目到个人Github仓库。\n2. 注册[Streamlit Cloud账号](https://share.streamlit.io/)，并连接到Github。\n3. 开始部署应用，具体可参考[官方教程](https://docs.streamlit.io/streamlit-community-cloud/get-started)。   \n4. 在应用的Secrets中配置Openai Key，具体格式参考下图：\n\u003cdiv style=\"display: flex;\"\u003e\n  \u003cimg src=\"https://github.com/PierXuY/ChatGPT-Assistant/blob/main/Figure/advanced-setting.png\" alt=\"advanced-setting.png\" style=\"flex: 1; width: 40%;\"/\u003e\n  \u003cimg src=\"https://github.com/PierXuY/ChatGPT-Assistant/blob/main/Figure/set-apikey.png\" alt=\"set-apikey.png\" style=\"flex: 1; width: 40%;\" /\u003e\n\u003c/div\u003e   \n也可以在部署完成后再进行配置。\n\n## 本地部署\n1. 建立虚拟环境（建议）\n\n2. 克隆项目（也可以手动下载到本地）\n```bash\ngit clone https://github.com/PierXuY/ChatGPT-Assistant.git\n```\n\n3. 安装依赖\n```bash\npip install -r requirements.txt\n```\n\n4. 设置API Key;设置API Base（可选）\n\n- 在 `.streamlit/secrets.toml`文件中写入`apikey = \"Openai Key\"`\n- 在 `.streamlit/secrets.toml`文件中写入代理接口即可实现免科学使用，格式为`apibase = \"代理接口地址\"`，说明如下：   \n  1. 可以直接使用项目[openai-forward](https://github.com/beidongjiedeguang/openai-forward)已搭建的代理接口，即`apibase = \"https://api.openai-forward.com/v1\"` 。\n  2. 可参考[openai-forward](https://github.com/beidongjiedeguang/openai-forward)项目自行搭建代理接口并进行设置。\n\n5. 启动应用\n```bash\nstreamlit run app.py\n```\n\n## 桌面应用\n基于项目[package-url](https://github.com/PierXuY/package-url)打包\n- 下载[Releases](https://github.com/PierXuY/ChatGPT-Assistant/releases)中的程序并安装\n- 安装完成后打开即可使用，默认指向的是已部署示例项目\n- 打开config文件夹中的conf.json文件，修改url即可指向个人的已部署项目，首次打开需要进行登录，速度较慢\n\n# 说明\n- 在[custom.py](https://github.com/PierXuY/ChatGPT-Assistant/blob/main/libs/custom.py)文件中可自定义用户名和SVG格式头像[(来源)](https://www.dicebear.com/playground?style=identicon)。\n- 在部署的项目源码中编辑[set_context.py](https://github.com/PierXuY/ChatGPT-Assistant/blob/main/libs/set_context.py)，即可增加预设定的上下文选项，会自动同步到应用中。\n- 有条件的可以考虑把[helper.py](https://github.com/PierXuY/ChatGPT-Assistant/blob/main/libs/helper.py)中的文件读写逻辑改为云数据库操作，防止历史记录丢失。\n\n\n# 致谢\n- 最早是基于[shan-mx/ChatGPT_Streamlit](https://github.com/shan-mx/ChatGPT_Streamlit)项目进行的改造，感谢。\n- 预设的[提示语](https://github.com/PierXuY/ChatGPT-Assistant/blob/main/set_context.py)参考自[binary-husky/chatgpt_academic](https://github.com/binary-husky/chatgpt_academic)项目和[f/awesome-chatgpt-prompts](https://github.com/f/awesome-chatgpt-prompts)项目，感谢。\n- 语音交互功能参考了项目[talk-to-chatgpt](https://github.com/C-Nedelcu/talk-to-chatgpt)和[Voice Control for ChatGPT](https://chrome.google.com/webstore/detail/voice-control-for-chatgpt/eollffkcakegifhacjnlnegohfdlidhn)的实现，感谢。\n- 本地免科学上网功能可以借助项目[openai-forward](https://github.com/beidongjiedeguang/openai-forward)，感谢。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpierxuy%2Fchatgpt-assistant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpierxuy%2Fchatgpt-assistant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpierxuy%2Fchatgpt-assistant/lists"}