xing61 / zzz-api

优质稳定的OpenAI的API接口-For企业和开发者。OpenAI的api proxy,支持ChatGPT的API调用,支持openai的API接口,支持:gpt-4,gpt-3.5。不需要openai Key, 不需要买openai的账号,不需要美元的银行卡,通通不用的,直接调用就行,稳定好用!!智增增
https://gpt.zhizengzeng.com/#/login
635 stars 53 forks source link

仍然超时怎么解决啊,拜托! #24

Closed smallder123 closed 22 hours ago

smallder123 commented 2 months ago

我的代码部分是这样写的 微信图片_20240819170410 报错如下 Traceback (most recent call last): File "/root/anaconda3/lib/python3.11/site-packages/urllib3/connection.py", line 159, in _new_conn conn = connection.create_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/anaconda3/lib/python3.11/site-packages/urllib3/util/connection.py", line 84, in create_connection raise err File "/root/anaconda3/lib/python3.11/site-packages/urllib3/util/connection.py", line 74, in create_connection sock.connect(sa) TimeoutError: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/root/anaconda3/lib/python3.11/site-packages/urllib3/connectionpool.py", line 670, in urlopen httplib_response = self._make_request( ^^^^^^^^^^^^^^^^^^^ File "/root/anaconda3/lib/python3.11/site-packages/urllib3/connectionpool.py", line 381, in _make_request self._validate_conn(conn) File "/root/anaconda3/lib/python3.11/site-packages/urllib3/connectionpool.py", line 978, in _validate_conn conn.connect() File "/root/anaconda3/lib/python3.11/site-packages/urllib3/connection.py", line 309, in connect conn = self._new_conn() ^^^^^^^^^^^^^^^^ File "/root/anaconda3/lib/python3.11/site-packages/urllib3/connection.py", line 164, in _new_conn raise ConnectTimeoutError( urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.HTTPSConnection object at 0x7fb9fa167a10>, 'Connection to api.openai.com timed out. (connect timeout=600)')

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/root/anaconda3/lib/python3.11/site-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( ^^^^^^^^^^^^^ File "/root/anaconda3/lib/python3.11/site-packages/urllib3/connectionpool.py", line 754, in urlopen return self.urlopen( ^^^^^^^^^^^^^ File "/root/anaconda3/lib/python3.11/site-packages/urllib3/connectionpool.py", line 754, in urlopen return self.urlopen( ^^^^^^^^^^^^^ File "/root/anaconda3/lib/python3.11/site-packages/urllib3/connectionpool.py", line 726, in urlopen retries = retries.increment( ^^^^^^^^^^^^^^^^^^ File "/root/anaconda3/lib/python3.11/site-packages/urllib3/util/retry.py", line 446, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/chat/completions (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7fb9fa167a10>, 'Connection to api.openai.com timed out. (connect timeout=600)'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/root/anaconda3/lib/python3.11/site-packages/openai/api_requestor.py", line 596, in request_raw result = _thread_context.session.request( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/anaconda3/lib/python3.11/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, send_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/anaconda3/lib/python3.11/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/anaconda3/lib/python3.11/site-packages/requests/adapters.py", line 507, in send raise ConnectTimeout(e, request=request) requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/chat/completions (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7fb9fa167a10>, 'Connection to api.openai.com timed out. (connect timeout=600)'))

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

Traceback (most recent call last): File "/root/data1/MozartsTouch/MozartsTouch/utils/txt_converter.py", line 90, in converted_result = txt_con.txt_converter(content) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/data1/MozartsTouch/MozartsTouch/utils/txt_converter.py", line 65, in txt_converter completion = openai.ChatCompletion.create( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/anaconda3/lib/python3.11/site-packages/openai/api_resources/chat_completion.py", line 25, in create return super().create(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/anaconda3/lib/python3.11/site-packages/openai/api_resources/abstract/engine_apiresource.py", line 153, in create response, , api_key = requestor.request( ^^^^^^^^^^^^^^^^^^ File "/root/anaconda3/lib/python3.11/site-packages/openai/api_requestor.py", line 288, in request result = self.request_raw( ^^^^^^^^^^^^^^^^^ File "/root/anaconda3/lib/python3.11/site-packages/openai/api_requestor.py", line 607, in request_raw raise error.Timeout("Request timed out: {}".format(e)) from e openai.error.Timeout: Request timed out: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/chat/completions

smallder123 commented 2 months ago

已经解决啦