openai.error.APIConnectionError
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 39.5k
- Forks
- 4.8k
- PR merge metrics
- No merged PRs in 30d
Description
Traceback (most recent call last):
File "D:\personal\projects\baichuan-test\test-api.py", line 25, in
result = get_completion("针对“13岁男孩花318元烫发 家长报警”这个话题进行发表论述")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\personal\projects\baichuan-test\test-api.py", line 19, in get_completion
response = openai.ChatCompletion.create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Software\miniconda\Lib\site-packages\openai\api_resources\chat_completion.py", line 25, in create
return super().create(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Software\miniconda\Lib\site-packages\openai\api_resources\abstract\engine_api_resource.py", line 153, in create
response, _, api_key = requestor.request(
^^^^^^^^^^^^^^^^^^
File "D:\Software\miniconda\Lib\site-packages\openai\api_requestor.py", line 288, in request
result = self.request_raw(
^^^^^^^^^^^^^^^^^
File "D:\Software\miniconda\Lib\site-packages\openai\api_requestor.py", line 609, in request_raw
raise error.APIConnectionError(
openai.error.APIConnectionError: Error communicating with OpenAI: HTTPConnectionPool(host='xx.xx.xx.xx', port=8003): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x00000252FA81B050>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。'))
When I run it locally on the server and access localhost, it works. But when I use another computer to access the server, the above error is reported.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the traceback from test-api.py and the remote URL shown for /v1/chat/completions. Check how the server is exposed on port 8003 and compare local versus remote connectivity. Done means a client on another computer can reach the endpoint, or the issue clearly documents the required network configuration and limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100