Git Product home page Git Product logo

chatgpt-html's Introduction

chatgpt-html

使用acheong08对接官方ChatGPT接口,实现简单HTML网页版在线聊天

该版本基于ChatGPT网页端代理开发(免费),想使用ChatGPT API KEY(付费)的请访问chatgpt-web

特性

  • 文件结构简单,主要面向小白用户
  • 功能不多,但核心的连续对话、多用户会话隔离、markdown格式输出都具备

部署

使用Docker Compose

以下所有文件放同一目录

  • 新建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
}
  • session_token获取方法(随时过期)
  1. Go to https://chat.openai.com/chat and open the developer tools by F12.
  2. Find the __Secure-next-auth.session-token cookie in Application > Storage > Cookies > https://chat.openai.com.
  3. Copy the value in the Cookie Value field.
  • access_token获取方法(据说可以持续2周不过期)

登录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即启动成功

注意事项

  • 访问地址为http://ip:port
  • 修改chat.html文件后,需要docker restart htmchat才能生效

其他相关

  • 出于玩玩bing的chatgpt心态,按waylaidwanderer搞了一套测试站(需要先点击聊天框左边的图标切换模型,默认模型是API,我的KEY没额度了),Bing就是GPT-4,Sydney是“破解”过的Bing(没有每轮对话最多15次和每天对话最多150次的限制,但是智商差一点)。另外此项目代码也有bug需要完善(如果你去体验会发现的),不做详细介绍。 RIVG68}0DCNFD)8MH@OO%W2 ~@M18}0M{LXG6$`5{ZDG{XU
  • 基于pandora制作了官方OPENAI CHATGPT高仿站

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.