Giter VIP home page Giter VIP logo

chatgpt-web's Introduction

使用最新ChatGPT最新API创建的聊天页面,模型回复效果与官网的ChatGPT一致

注册openai后送18美元,3个月内使用,API调用,0.2美分1000 token

更新说明

2023.3.5: 支持markdown内容显示
2323.3.6: 支持保存历史聊天记录,当重新打开会话时自动恢复聊天记录,使用pickle持久化存储
2323.3.6: 会话与用户id绑定,其余设备输入用户id后依然可以重载聊天记录

使用前提

  1. 因国内IP被封或OpenAI API被墙,因此自己需要有代理,稍后需要配置
  2. 有openai账号,注册事项可以参考此文章
  3. 创建好api_key, 进入OpenAI链接,右上角点击,进入页面设置
    image

使用方法

  1. 执行pip install openai pip install flask安装必要包
  2. 打开flask_main.py文件
  3. openai.api_key填写为自己的api key
  4. 将os.environ['HTTP_PROXY']和os.environ['HTTPS_PROXY']设置成代理,注意端口设置
  5. 执行python flask_main.py运行程序.若程序中未指定apikey还可以执行OPANAI_API_KEY=XXXX python flask_main.py来指定,其中XXXX为你的apikey
  6. 打开本地浏览器访问127.0.0.1:5000

介绍

  • 开启程序后进入如下页面
    image
  • 输入已有用户id,或者输入new_id:xxx创建新id,这个id用于绑定会话,下次不同浏览器打开都可以恢复用户的聊天记录,如下为创建一个新id,一个浏览器31天内不会要求再次输入用户id image
  • 默认为普通对话模式,即每次发送都是仅对于该提问回答,可点击切换为连续对话模式,chatgpt将会联系上下文(之前的对话,程序中设置了最大5条记录)回复你,但意味着花费会更多money
  • 用python写一个冒泡算法试试看,回车发送,shift+回车换行
  • 然后问用C语言呢?会联系上下文回答 image

TODO List

  • 界面优化
  • 优化代码显示
  • 在连续对话模式下支持多人同时使用
  • 重载历史记录
  • 切换聊天模式和重置时提示
  • 公式显示

chatgpt-web's People

Contributors

liangyang666 avatar

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.