SnapdragonLee / ChatGPT-weBot

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

KeyError: 'choices'报错 #79

Closed itsdapi closed 1 year ago

itsdapi commented 1 year ago

有一段时间没用了 试了一下会报这个错误 之前还是能用的

Exception in thread Thread-5:
Traceback (most recent call last):
  File "C:\Users\dapi\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "C:\Users\dapi\webot-chatgpt\ChatGPT-weBot\multithread\threads.py", line 23, in run
    item.play()
  File "C:\Users\dapi\webot-chatgpt\ChatGPT-weBot\basic\task.py", line 69, in play
    self.reply += self.bot.ask(prompt=self.prompt, access_internet=self.access,
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\dapi\webot-chatgpt\ChatGPT-weBot\apibase\ChatGPTAPI.py", line 221, in ask
    response_text = content["choices"][0]["message"]
                    ~~~~~~~^^^^^^^^^^^
KeyError: 'choices'
SnapdragonLee commented 1 year ago

这个报错的意思是key没有填写正确,或没有余额了,应该是这样的情况

itsdapi commented 1 year ago

这个报错的意思是key没有填写正确,或没有余额了,应该是这样的情况

哦哦好的我回去看看

SnapdragonLee commented 1 year ago

目前没有更新的回复,如果有新问题请重新打开本issue进行提问,谢谢!