circlestarzero / EX-chatGPT

Let ChatGPT truly learn how to go online and call APIs! 'EX-ChatGPT' can rival and even surpass NewBing
MIT License
2k stars 329 forks source link

SSL error #25

Open collins7184 opened 1 year ago

collins7184 commented 1 year ago

环境:wsl2 ubantu-22.04 lts 运行程序时调用proxychains,走socks5通道 Traceback (most recent call last): File "/home/collins/.local/lib/python3.10/site-packages/flask/app.py", line 2091, in call return self.wsgi_app(environ, start_response) File "/home/collins/.local/lib/python3.10/site-packages/flask/app.py", line 2076, in wsgi_app response = self.handle_exception(e) File "/home/collins/.local/lib/python3.10/site-packages/flask/app.py", line 2073, in wsgi_app response = self.full_dispatch_request() File "/home/collins/.local/lib/python3.10/site-packages/flask/app.py", line 1518, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/collins/.local/lib/python3.10/site-packages/flask/app.py", line 1516, in full_dispatch_request rv = self.dispatch_request() File "/home/collins/.local/lib/python3.10/site-packages/flask/app.py", line 1502, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(req.view_args) File "/home/collins/EX-chatGPT/chatGPTEx/main.py", line 51, in get_bot_response res = parse_text(web(q,conv_id=uuid)) File "/home/collins/EX-chatGPT/chatGPTEx/search.py", line 58, in web resp = directQuery(f'Chat History info: {chatbot.conversation[conv_id]}\n Query: {query}', conv_id= conv_id) File "/home/collins/EX-chatGPT/chatGPTEx/search.py", line 116, in directQuery response = chatbot.ask(prompt+'\n'+query,convo_id=conv_id) File "/home/collins/EX-chatGPT/chatGPTEx/optimizeOpenAI.py", line 219, in ask full_response: str = "".join(response) File "/home/collins/EX-chatGPT/chatGPTEx/optimizeOpenAI.py", line 165, in ask_stream response = self.session.post( File "/home/collins/.local/lib/python3.10/site-packages/requests/sessions.py", line 590, in post return self.request('POST', url, data=data, json=json, kwargs) File "/home/collins/.local/lib/python3.10/site-packages/requests/sessions.py", line 542, in request resp = self.send(prep, send_kwargs) File "/home/collins/.local/lib/python3.10/site-packages/requests/sessions.py", line 655, in send r = adapter.send(request, kwargs) File "/home/collins/.local/lib/python3.10/site-packages/requests/adapters.py", line 514, in send raise SSLError(e, request=request) requests.exceptions.SSLError: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/chat/completions (Caused by SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:997)')))

apike.ini [Google] GOOGLE_API_KEY = SEARCH_ENGINE_ID = [OpenAI] key0 = [WolframAlpha] WOLFRAMALPHA_APP_ID = [Proxy] api_proxy =https://api.openai.com/v1/chat/completions

来自chatgpt的回答: 这个错误通常是由于服务器没有响应或网络连接中断导致的。如果这个错误发生在使用curl访问某个API时,可以尝试以下步骤:

确保目标API服务正在运行,可以尝试在浏览器中打开API地址,看是否可以正常访问。 检查网络连接,确保您的计算机可以连接到目标API服务器。您可以尝试使用ping命令测试与服务器的连接性,如:ping api.example.com。 如果目标API使用HTTPS协议,请确保您的计算机具有适当的SSL证书,否则可能无法建立安全连接。您可以尝试使用curl的--insecure选项禁用SSL证书验证,如:curl --insecure https://api.example.com。 尝试使用其他工具或库(如Postman、requests)访问目标API,以查看是否存在与curl相关的问题。如果其他工具也无法访问API,则问题可能是与API服务有关的。 如果以上步骤都没有解决问题,可以尝试联系API服务提供商获取更多支持。

linux shell command: proxychains curl chat.openai.com ProxyChains-3.1 (http://proxychains.sf.net) |S-chain|-<>-172.18.144.1:58225-<><>-40.90.4.2:80-<><>-OK curl: (52) Empty reply from server

clash log: image

unclesammy commented 1 year ago

我也是urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/chat/completions (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)')))这个问题,用的是机场的网。