Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

连接OpenAI一直报超时 #29

Closed
shinedlc opened this issue Jun 6, 2024 · 3 comments
Closed

连接OpenAI一直报超时 #29

shinedlc opened this issue Jun 6, 2024 · 3 comments

Comments

@shinedlc
Copy link

shinedlc commented Jun 6, 2024

2024/06/06 20:33:38 Speaker ✅ 服务已启动...
2024/06/06 20:33:55 Speaker 🔥 召唤傻妞
2024/06/06 20:33:55 Speaker 🔊 你好,我是傻妞,很高兴认识你
2024/06/06 20:34:04 Speaker 🔥 为什么是蓝色的
2024/06/06 20:34:04 Speaker 🔊 请稍等
2024/06/06 20:37:53 Open AI ❌ LLM 响应异常 APIConnectionError: Connection error.
at OpenAI.makeRequest (/Users/thomas/Documents/Projects/AI/mi-gpt/node_modules/openai/core.js:292:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async OpenAIClient.chatStream (/Users/thomas/Documents/Projects/AI/mi-gpt/dist/index.cjs:1145:20) {
status: undefined,
headers: undefined,
request_id: undefined,
error: undefined,
code: undefined,
param: undefined,
type: undefined,
cause: FetchError: request to https://api.openai.com/v1/chat/completions failed, reason: connect ETIMEDOUT 128.242.250.148:443
at ClientRequest. (/Users/thomas/Documents/Projects/AI/mi-gpt/node_modules/node-fetch/lib/index.js:1501:11)
at ClientRequest.emit (node:events:514:28)
at TLSSocket.socketErrorListener (node:_http_client:495:9)
at TLSSocket.emit (node:events:526:35)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
type: 'system',
errno: 'ETIMEDOUT',
code: 'ETIMEDOUT'
}
}
2024/06/06 20:37:53 Speaker 🔊 啊哦,出错了,请稍后再试吧!

@shinedlc shinedlc closed this as completed Jun 6, 2024
@shinedlc shinedlc changed the title 连接OpenAI一直报超时,有解决办法吗,电脑直接请求OPENAPI接口能通 连接OpenAI一直报超时 Jun 6, 2024
@idootop
Copy link
Owner

idootop commented Jun 6, 2024

@shinedlc 看来你已经解决了,不过我再补充一下,对于国内环境无法访问 OpenAI 服务的情况,有以下几种处理方法:

  1. 环境变量里填上你的代理地址,比如:HTTP_PROXY=http://127.0.0.1:7890
  2. 使用第三方部署的 OpenAI API 反向代理服务,然后更新 BASE_URL
  3. 使用国内的 LLM,比如 Moonshot、零一万物、通义千问等

对于你上面发的连接超时的问题,大概率是你的代理网络不稳定,更换其他代理试试。

@shinedlc
Copy link
Author

shinedlc commented Jun 6, 2024

@shinedlc 看来你已经解决了,不过我再补充一下,对于国内环境无法访问 OpenAI 服务的情况,有以下几种处理方法:

  1. 环境变量里填上你的代理地址:HTTP_PROXY=xxxxxx
  2. 使用第三方部署的 OpenAI API 反向代理服务,然后更新 BASE_URL
  3. 使用国内的 LLM,比如 Moonshot、零一万物、通义千问等

对于你上面发的连接超时的问题,大概率是你的代理网络不稳定,更换其他代理试试。

感谢回复,接着OPENAI后面配置吗,支持局域网这种吗:
HTTP_PROXY=socks://192.168.123.161:1080

@shinedlc
Copy link
Author

shinedlc commented Jun 6, 2024

OK了,用http版。。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants