使用ChatGPT接口,实现简单HTML网页版在线聊天(支持连续对话及会话隔离)
4.6K
该版本基于
ChatGPT网页端代理开发(免费),想使用ChatGPT API KEY(付费)的请访问chatgpt-web
以下所有文件放同一目录
config.json文件,粘贴以下代码并保存{
"__comment01__": "邮箱、session_token和access_token三选一",
"__comment02__": "邮箱认证(暂仅支持普通方式注册的账号,不支持谷歌或微软快捷登录)",
"email": "",
"password": "",
"__comment03__": "session_token认证(不受账号注册方式影响)",
"session_token": "",
"__comment04__": "access_token认证(不受账号注册方式影响)",
"access_token": "",
"__comment05__": "以下为选填字段",
"__comment06__": "通过代理连接代理端(作者服务器被墙过,代理好像只能用无密码认证的socks5或者http,请自行测试)",
"proxy": "",
"__comment07__": "使用付费openai账号(官方称速度更快,无频率限制,将false改为true)",
"paid": false
}
F12.__Secure-next-auth.session-token cookie in Application > Storage > Cookies > https://chat.openai.com.Cookie Value field.登录ChatGPT官方网页版后再打开https://chat.openai.com/api/auth/session
docker-compose.yml配置文件,粘贴以下内容并保存services:
chatgpt:
image: sheepgreen/chatgpt-html
container_name: htmchat
# environment:
# - CHATGPT_BASE_URL=你的代理服务端地址(不填默认使用作者服务器,目前偶尔会不可用)
volumes:
- ./config.json:/chatgpt-html/config.json
# - ./chat.html:/chatgpt-html/templates/chat.html #默认内置我的UI,如需替换自用网页请取消注释
ports:
- "9999:8088" #8088为容器内端口,不可更换;9999为外部端口,可自行更换
restart: always
docker-compose up -d即启动成功chat.html文件后,需要docker restart htmchat才能生效Bing就是GPT-4,Sydney是“破解”过的Bing(没有每轮对话最多15次和每天对话最多150次的限制,但是智商差一点)。另外此项目代码也有bug需要完善(如果你去体验会发现的),不做详细介绍。

Content type
Image
Digest
sha256:a25b8174a…
Size
105.9 MB
Last updated
about 3 years ago
docker pull sheepgreen/chatgpt-html