SnapdragonLee / ChatGPT-weBot

Chat with ChatGPT (gpt-3.5 or newer),WeChat hook interface based
655 stars 117 forks source link

报错使用chatgpt 网页的 #54

Closed joe12801 closed 1 year ago

joe12801 commented 1 year ago

1)) (1.26.15) Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.11/site-packages (from requests->-r ./requirements.txt (line 1)) (2022.12.7) Installing collected packages: regex, tiktoken Successfully installed regex-2023.3.23 tiktoken-0.3.2 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

[notice] A new release of pip available: 22.3.1 -> 23.0.1 [notice] To update, run: pip3 install --upgrade pip root@debian:~/ChatGPT-weBot# python3 main.py {'content': 'hello guys', 'id': '20230324023319', 'receiver': 'CLIENT', 'sender': 'SERVER', 'srvid': 1, 'status': 'SUCCSESSED', 'time': '2023-03-24 02:33:19', 'type': 5} {'content': '{"wx_code":"Joe1280520","wx_head_image":"http://wx.qlogo.cn/mmhead/ver_1/dGSfSuyic3PWEGAuJLc454ibUjT6kd1Ga9GHXstwE2YKfJTECrWWpNWv9g18vUP0YjAAAqRI0JkAdqgqpbPic1FXQVK86icr9jStU2lJ8AB8cZ0/132","wx_id":"wxid_t8u89ousa2l912","wx_name":"ChatGPT 2"}', 'id': '20230323143320', 'receiver': 'CLIENT', 'sender': 'SERVER', 'srvid': 1, 'status': 'SUCCSESSED', 'time': '2023-03-24 02:33:19', 'type': 6500} {'content': '-c hello', 'id': '20230324023333', 'id1': '', 'id2': '', 'id3': '', 'srvid': 1, 'time': '2023-03-24 02:33:33', 'type': 1, 'wxid': 'peng1631988'} ask:hello Exception in thread Thread-5: Traceback (most recent call last): File "/usr/local/lib/python3.11/threading.py", line 1038, in _bootstrap_inner self.run() File "/root/ChatGPT-weBot/multithread/threads.py", line 23, in run item.play() File "/root/ChatGPT-weBot/basic/task.py", line 69, in play self.reply += self.bot.ask(prompt=self.prompt, access_internet=self.access, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/ChatGPT-weBot/apibase/ChatGPTAPI.py", line 202, in ask response_text = content["choices"][0]["message"]


KeyError: 'choices'
SnapdragonLee commented 1 year ago

检查一下 API key写没写,然后查看还有没有钱