slippersheepig / chatgpt-html Goto Github PK
View Code? Open in Web Editor NEW使用ChatGPT接口,实现简单HTML网页版在线聊天(支持markdown语法、多用户会话隔离及查看连续对话记录)
Home Page: https://chat.sheepig.top
使用ChatGPT接口,实现简单HTML网页版在线聊天(支持markdown语法、多用户会话隔离及查看连续对话记录)
Home Page: https://chat.sheepig.top
➜ chatgpt-html git:(proxy) ✗ sudo docker-compose up
htmchat is up-to-date
Attaching to htmchat
htmchat | [2023-02-25 13:20:18 +0000] [1] [INFO] Starting gunicorn 20.1.0
htmchat | [2023-02-25 13:20:18 +0000] [1] [INFO] Listening at: http://0.0.0.0:8088 (1)
htmchat | [2023-02-25 13:20:18 +0000] [1] [INFO] Using worker: gevent
htmchat | [2023-02-25 13:20:18 +0000] [7] [INFO] Booting worker with pid: 7
htmchat | [2023-02-25 13:20:23 +0000] [7] [ERROR] Exception in worker process
htmchat | Traceback (most recent call last):
htmchat | File "/home/appuser/.local/lib/python3.11/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
htmchat | worker.init_process()
htmchat | File "/home/appuser/.local/lib/python3.11/site-packages/gunicorn/workers/ggevent.py", line 146, in init_process
htmchat | super().init_process()
htmchat | File "/home/appuser/.local/lib/python3.11/site-packages/gunicorn/workers/base.py", line 134, in init_process
htmchat | self.load_wsgi()
htmchat | File "/home/appuser/.local/lib/python3.11/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
htmchat | self.wsgi = self.app.wsgi()
我启动main的镜像,出现了以下错误,
(我进入镜像发现chrome是安装好的,不知道哪里出错了 )
[2023-02-21 03:34:01 +0000] [118] [ERROR] Exception in worker process
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
worker.init_process()
File "/usr/local/lib/python3.11/site-packages/gunicorn/workers/ggevent.py", line 146, in init_process
super().init_process()
File "/usr/local/lib/python3.11/site-packages/gunicorn/workers/base.py", line 134, in init_process
self.load_wsgi()
File "/usr/local/lib/python3.11/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
self.wsgi = self.app.wsgi()
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
return self.load_wsgiapp()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
return util.import_app(self.app_uri)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/gunicorn/util.py", line 359, in import_app
mod = importlib.import_module(module)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1206, in _gcd_import
File "", line 1178, in _find_and_load
File "", line 1149, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/chatgpt-html/main.py", line 12, in
chatbot = Chatbot(config)
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/revChatGPT/Unofficial.py", line 72, in init
self.__email_login()
File "/usr/local/lib/python3.11/site-packages/revChatGPT/Unofficial.py", line 481, in __email_login
driver = uc.Chrome(
^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/undetected_chromedriver/init.py", line 441, in init
super(Chrome, self).init(
File "/usr/local/lib/python3.11/site-packages/selenium/webdriver/chrome/webdriver.py", line 80, in init
super().init(
File "/usr/local/lib/python3.11/site-packages/selenium/webdriver/chromium/webdriver.py", line 104, in init
super().init(
File "/usr/local/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 286, in init
self.start_session(capabilities, browser_profile)
File "/usr/local/lib/python3.11/site-packages/undetected_chromedriver/init.py", line 704, in start_session
super(selenium.webdriver.chrome.webdriver.WebDriver, self).start_session(
File "/usr/local/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 378, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 440, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.11/site-packages/selenium/webdriver/remote/errorhandler.py", line 245, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at 127.0.0.1:50131
from chrome not reachable
Stacktrace:
#0 0x55d9dc042d93
#1 0x55d9dbe1115d
#2 0x55d9dbdffa2b
#3 0x55d9dbe3dc63
#4 0x55d9dbe352fc
#5 0x55d9dbe7a4f4
#6 0x55d9dbe71353
#7 0x55d9dbe40e40
#8 0x55d9dbe42038
#9 0x55d9dc0968be
#10 0x55d9dc09a8f0
#11 0x55d9dc07af90
#12 0x55d9dc09bb7d
#13 0x55d9dc06c578
#14 0x55d9dc0c0348
#15 0x55d9dc0c04d6
#16 0x55d9dc0da341
#17 0x7f81c064fea7 start_thread
[2023-02-12 12:55:47 +0000] [8] [INFO] Starting gunicorn 20.1.0
[2023-02-12 12:55:47 +0000] [8] [INFO] Listening at: http://0.0.0.0:80 (8)
[2023-02-12 12:55:47 +0000] [8] [INFO] Using worker: gevent
[2023-02-12 12:55:47 +0000] [11] [INFO] Booting worker with pid: 11
[2023-02-12 12:59:08 +0000] [8] [CRITICAL] WORKER TIMEOUT (pid:11)
[2023-02-12 12:59:08 +0000] [11] [INFO] Worker exiting (pid: 11)
Spawning browser...
Browser spawned.
[2023-02-12 12:59:08 +0000] [275] [INFO] Booting worker with pid: 275
服务器能够正常访问openai的网站,请大佬解惑
按照readme的步骤来进行配置,以下是我docker-compose.yml和config.json的相关配置,在config.json我是用邮箱账号登录的。
[
](url)
最后docker命令也启用了,结果提问后却是未响应,如下图
@slippersheepig
2023-3-7版本,在amd64下闪跳
不知道配成什么东西,配成域名提示404
CHATGPT_BASE_URL=你的代理服务端地址(不填默认使用作者服务器,目前偶尔会不可用)
这个地方是可以自己部署一个
ChatGPT-Proxy 这个项目,然后填写自己的服务器地址吗?
如果是 那变量是怎么样一个格式?
Docker logs:
File "/home/appuser/.local/lib/python3.11/site-packages/OpenAIAuth.py", line 76, in begin
self.__part_one(token=csrf_token)
File "/home/appuser/.local/lib/python3.11/site-packages/OpenAIAuth.py", line 117, in __part_one
self.__part_two(url=url)
File "/home/appuser/.local/lib/python3.11/site-packages/OpenAIAuth.py", line 146, in __part_two
self.__part_three(state=state)
File "/home/appuser/.local/lib/python3.11/site-packages/OpenAIAuth.py", line 170, in __part_three
self.__part_four(state=state)
File "/home/appuser/.local/lib/python3.11/site-packages/OpenAIAuth.py", line 208, in __part_four
self.__part_five(state=state)
File "/home/appuser/.local/lib/python3.11/site-packages/OpenAIAuth.py", line 245, in __part_five
self.__part_six(old_state=state, new_state=new_state)
File "/home/appuser/.local/lib/python3.11/site-packages/OpenAIAuth.py", line 271, in __part_six
self.__part_seven(redirect_url=redirect_url, previous_url=url)
File "/home/appuser/.local/lib/python3.11/site-packages/OpenAIAuth.py", line 300, in __part_seven
raise Error(
OpenAIAuth.Error
[2023-03-03 14:45:15 +0000] [7] [INFO] Worker exiting (pid: 7)
[2023-03-03 14:45:16 +0000] [1] [INFO] Shutting down: Master
[2023-03-03 14:45:16 +0000] [1] [INFO] Reason: Worker failed to boot.
[2023-03-03 14:45:23 +0000] [1] [INFO] Starting gunicorn 20.1.0
[2023-03-03 14:45:23 +0000] [1] [INFO] Listening at: http://0.0.0.0:8088 (1)
[2023-03-03 14:45:23 +0000] [1] [INFO] Using worker: gevent
[2023-03-03 14:45:23 +0000] [7] [INFO] Booting worker with pid: 7
[2023-03-03 14:45:31 +0000] [7] [ERROR] Exception in worker process
config.json:
{
"email": "填写你的OpenAI账号(即邮箱)",
"password": "填写你的OpenAI密码"
}
微软快捷登录可以用吗,在有能限制一下,请求次数排队问
我在服务器上尝试安装两次,都不够空间,大概需要多少呢?
https://github.com/ojdev/chatgpt-webapi
正确的会话处理逻辑应该如此
File "/usr/local/lib/python3.11/site-packages/OpenAIAuth/OpenAIAuth.py", line 352, in get_access_token\n","stream":"stderr","time":"2023-02-17T03:25:00.121560866Z"}
{"log":" self.access_token = response.json()["accessToken"]\n","stream":"stderr","time":"2023-02-17T03:25:00.121564987Z"}
{"log":" ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^\n","stream":"stderr","time":"2023-02-17T03:25:00.121569417Z"}
{"log":"KeyError: 'accessToken'\n","stream":"stderr","time":"2023-02-17T03:25:00.121573633Z"}
pandoraAI测试站,好像必须扶梯? 简单测试了,似乎不挑ip?
我本地搭建,api正常使用,为啥他一直显示500错误,可以正常科学上网
装在了vps上,网页不通。 用portainer观察,container貌似在运行,但log说:
json.decoder.JSONDecodeError: Unexpected UTF-8 BOM (decode using utf-8-sig): line 1 column 1 (char 0)
[2023-03-11 14:40:22 +0000] [6] [INFO] Worker exiting (pid: 6)
[2023-03-11 14:40:23 +0000] [1] [INFO] Shutting down: Master
[2023-03-11 14:40:23 +0000] [1] [INFO] Reason: Worker failed to boot.
[2023-03-11 14:41:25 +0000] [1] [INFO] Starting gunicorn 20.1.0
[2023-03-11 14:41:25 +0000] [1] [INFO] Listening at: http://0.0.0.0:8088 (1)
[2023-03-11 14:41:25 +0000] [1] [INFO] Using worker: gevent
[2023-03-11 14:41:25 +0000] [6] [INFO] Booting worker with pid: 6
[2023-03-11 14:41:26 +0000] [6] [ERROR] Exception in worker process
Traceback (most recent call last):
File "/home/appuser/.local/lib/python3.11/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
worker.init_process()
File "/home/appuser/.local/lib/python3.11/site-packages/gunicorn/workers/ggevent.py", line 146, in init_process
super().init_process()
File "/home/appuser/.local/lib/python3.11/site-packages/gunicorn/workers/base.py", line 134, in init_process
self.load_wsgi()
File "/home/appuser/.local/lib/python3.11/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
self.wsgi = self.app.wsgi()
^^^^^^^^^^^^^^^
File "/home/appuser/.local/lib/python3.11/site-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
^^^^^^^^^^^
File "/home/appuser/.local/lib/python3.11/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
return self.load_wsgiapp()
^^^^^^^^^^^^^^^^^^^
File "/home/appuser/.local/lib/python3.11/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
return util.import_app(self.app_uri)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/appuser/.local/lib/python3.11/site-packages/gunicorn/util.py", line 359, in import_app
mod = importlib.import_module(module)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1206, in _gcd_import
File "", line 1178, in _find_and_load
File "", line 1149, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/chatgpt-html/main.py", line 8, in
with open("config.json", "r") as f: config = json.load(f)
^^^^^^^^^^^^
File "/usr/lib/python3.11/json/init.py", line 293, in load
return loads(fp.read(),
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/json/init.py", line 335, in loads
raise JSONDecodeError("Unexpected UTF-8 BOM (decode using utf-8-sig)",
json.decoder.JSONDecodeError: Unexpected UTF-8 BOM (decode using utf-8-sig): line 1 column 1 (char 0)
[2023-03-11 14:41:26 +0000] [6] [INFO] Worker exiting (pid: 6)
[2023-03-11 14:41:27 +0000] [1] [INFO] Shutting down: Master
[2023-03-11 14:41:27 +0000] [1] [INFO] Reason: Worker failed to boot.
[2023-03-11 14:42:29 +0000] [1] [INFO] Starting gunicorn 20.1.0
[2023-03-11 14:42:29 +0000] [1] [INFO] Listening at: http://0.0.0.0:8088 (1)
[2023-03-11 14:42:29 +0000] [1] [INFO] Using worker: gevent
[2023-03-11 14:42:29 +0000] [6] [INFO] Booting worker with pid: 6
[2023-03-11 14:42:31 +0000] [6] [ERROR] Exception in worker process
Traceback (most recent call last):
File "/home/appuser/.local/lib/python3.11/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
worker.init_process()
File "/home/appuser/.local/lib/python3.11/site-packages/gunicorn/workers/ggevent.py", line 146, in init_process
super().init_process()
File "/home/appuser/.local/lib/python3.11/site-packages/gunicorn/workers/base.py", line 134, in init_process
self.load_wsgi()
File "/home/appuser/.local/lib/python3.11/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
self.wsgi = self.app.wsgi()
^^^^^^^^^^^^^^^
File "/home/appuser/.local/lib/python3.11/site-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
^^^^^^^^^^^
File "/home/appuser/.local/lib/python3.11/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
return self.load_wsgiapp()
^^^^^^^^^^^^^^^^^^^
File "/home/appuser/.local/lib/python3.11/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
return util.import_app(self.app_uri)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/appuser/.local/lib/python3.11/site-packages/gunicorn/util.py", line 359, in import_app
mod = importlib.import_module(module)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1206, in _gcd_import
File "", line 1178, in _find_and_load
File "", line 1149, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/chatgpt-html/main.py", line 8, in
with open("config.json", "r") as f: config = json.load(f)
^^^^^^^^^^^^
File "/usr/lib/python3.11/json/init.py", line 293, in load
return loads(fp.read(),
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/json/init.py", line 335, in loads
raise JSONDecodeError("Unexpected UTF-8 BOM (decode using utf-8-sig)",
json.decoder.JSONDecodeError: Unexpected UTF-8 BOM (decode using utf-8-sig): line 1 column 1 (char 0)
[2023-03-11 14:42:31 +0000] [6] [INFO] Worker exiting (pid: 6)
[2023-03-11 14:42:31 +0000] [1] [INFO] Shutting down: Master
[2023-03-11 14:42:31 +0000] [1] [INFO] Reason: Worker failed to boot.
首先把防火墙的端口全部打开了,然后在本地git了main分支里的内容并上传到服务器里,cd chatgpt-html-main后把需要的文件都创建好了,只修改了端口号,运行docker-compose up -d后由于编码错误,我把main.py中的中文替换成了英文(是否和这步有关?),最后成功运行没有报错,但ip:端口不论在本地还是服务器上都time out,可能是什么原因呢?
GET http://localhost:8080/get?msg=111 404 (Not Found)
请问为什么会报这个错呀 单独使用chatbot问是可以得到回应的,但是套到前后端里就出问题了
1.问题请求接口改为post。get方法有字数限制,贴段长代码就报错了。
2.聊天会话没有做隔离,多人使用对话上下文会干扰。没有会话重置按钮。
我想不用docker直接運行,main.py 找不到 config.json?
這個文件在哪裡呢?
提问后返回异常
HTTPSConnectionPool(host='chatgpt.duti.tech', port=443): Max retries exceeded with url: /api/conversation (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fe837958150>: Failed to establish a new connection: [Errno -5] No address associated with hostname'))
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.