joeyHXD / aichat_chatGPT_API

Hoshino插件,可以用chatGPT的API对话
12 stars 3 forks source link

求助,感觉是代理加错了 #14

Closed 8wsd closed 1 year ago

8wsd commented 1 year ago

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "C:\Users\Administrator\Desktop\HoshinoBot2\hoshino\modules\aichat_chatGP T_API\AIChat.py", line 65, in get_group_reply response = self.get_full_response(self.messages + list(self.group_context)) File "C:\Users\Administrator\Desktop\HoshinoBot2\hoshino\modules\aichat_chatGP T_API\AIChat.py", line 85, in get_full_response response = openai.ChatCompletion.create( File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-p ackages\openai\api_resources\chat_completion.py", line 25, in create return super().create(*args, **kwargs) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-p ackages\openai\api_resources\abstract\engine_apiresource.py", line 153, in crea te response, , api_key = requestor.request( File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-p ackages\openai\api_requestor.py", line 288, in request result = self.request_raw( File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\site-p ackages\openai\api_requestor.py", line 609, in request_raw raise error.APIConnectionError( openai.error.APIConnectionError: Error communicating with OpenAI: HTTPSConnectio nPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/chat/ completions (Caused by ProxyError('Unable to connect to proxy', OSError('Tunnel connection failed: 400 Bad Request')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\Administrator\Desktop\HoshinoBot2\hoshino\service.py", line 192 , in wrapper return await func(self.bot, ctx) File "C:\Users\Administrator\Desktop\HoshinoBot2\hoshino\tool.py", line 58, in decorated return await f(*args, *kwargs) File "C:\Users\Administrator\Desktop\HoshinoBot2\hoshino\modules\aichat_chatGP T_API\chat.py", line 237, in ai_chat reply = await loop.run_in_executor(executor, chat.get_group_reply, msg) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\concur rent\futures\thread.py", line 52, in run result = self.fn(self.args, **self.kwargs) File "C:\Users\Administrator\Desktop\HoshinoBot2\hoshino\modules\aichat_chatGP T_API\AIChat.py", line 74, in get_group_reply print(e.http_body['type']) TypeError: 'NoneType' object is not subscriptable

joeyHXD commented 1 year ago

嗯,应该是代理问题,你试试能不能自己解决吧

8wsd commented 1 year ago

我不太懂该怎么使用

8wsd commented 1 year ago

“ip:port”吗?

joeyHXD commented 1 year ago

“ip:port”吗?

嗯,直接填就行 比如"http://127.0.0.1:7890" 你也可以写成dict,类似于图里这种 1a6f31ad9f6b202f

8wsd commented 1 year ago

谢谢