#1224 openai.APITimeoutError: Request timed out.

114.228* Posted at: 1 day ago 👁13

连接超时,请检查网络连接是否稳定:
Traceback (most recent call last):
File "httpx\_transports\default.py", line 101, in map_httpcore_exceptions
File "httpx\_transports\default.py", line 250, in handle_request
File "httpcore\_sync\connection_pool.py", line 216, in handle_request
File "httpcore\_sync\connection_pool.py", line 196, in handle_request
File "httpcore\_sync\connection.py", line 99, in handle_request
File "httpcore\_sync\connection.py", line 76, in handle_request
File "httpcore\_sync\connection.py", line 122, in _connect
File "httpcore\_backends\sync.py", line 205, in connect_tcp
File "contextlib.py", line 153, in exit
File "httpcore\_exceptions.py", line 14, in map_exceptions
httpcore.ConnectTimeout: timed out

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

Traceback (most recent call last):
File "openai\_base_client.py", line 982, in request
File "httpx\_client.py", line 913, in send
File "httpx\_client.py", line 941, in _send_handling_auth
File "httpx\_client.py", line 978, in _send_handling_redirects
File "httpx\_client.py", line 1013, in _send_single_request
File "httpx\_transports\default.py", line 249, in handle_request
File "contextlib.py", line 153, in exit
File "httpx\_transports\default.py", line 118, in map_httpcore_exceptions
httpx.ConnectTimeout: timed out

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

Traceback (most recent call last):
File "videotrans\util\TestSTT.py", line 18, in run
File "videotrans\recognition\__init__.py", line 195, in run
File "videotrans\recognition\_base.py", line 80, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\recognition\_openairecognapi.py", line 74, in _exec
File "openai\_utils\_utils.py", line 286, in wrapper
File "openai\resources\audio\transcriptions.py", line 333, in create
File "openai\_base_client.py", line 1259, in post
File "openai\_base_client.py", line 1000, in request
openai.APITimeoutError: Request timed out.


=
system:Windows-10-10.0.19045-SP0
version:v3.82
frozen:True
language:zh
root_dir:D:/videotrans

1 Replies

从错误日志看,这是在使用 OpenAI 语音识别 (STT) 时发生的网络连接超时问题。错误显示 openai.APITimeoutError: Request timed out,表明软件无法在合理时间内连接到 OpenAI 的服务器。

请按以下步骤排查:

  1. 检查网络连接:确保您的网络稳定且能够正常访问 OpenAI 的服务。
  2. 设置网络代理:如果您在中国大陆地区,通常需要配置代理才能稳定访问 OpenAI。请在软件菜单栏选择 翻译设置 -> 语音识别设置,在 OpenAI 相关的配置区域找到并设置正确的代理地址。
  3. 切换语音识别渠道:如果网络问题暂时无法解决,建议切换到本地语音识别模型。在软件主界面的 语音识别渠道 下拉菜单中,选择 faster-whisper(本地)openai-whisper(本地)。首次使用需要下载模型文件,但之后可离线运行,不受网络影响。
  4. 重试操作:网络波动也可能导致临时性超时,可以稍后重试。

如果问题持续存在,请确认您的 OpenAI API 密钥配置正确且账户状态正常。

Post Your Reply
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update.

Donate: https://ko-fi.com/jianchang512

Trending Questions