yihong0618 / xiaogpt

Play ChatGPT and other LLM with Xiaomi AI Speaker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

报错: Error communicating with OpenAI

danranmmm opened this issue · comments

问题:请回答天气
以下是小爱的回答: 西安雁塔明天小雨转阴,要带伞哦,10度到21度,降温5度,西风1级转西风3级,空气质量良。
以下是GPT的回答: GPT回答出错 Error communicating with OpenAI
为什么我的一直GPT报错链接不上啊,我美国服务器的节点,可以正常访问openAI和ChatGPT,我用的windows,把代理端口也改成允许的了,然后使用就一直报错 GPT回答出错 Error communicating with OpenAI,也没其他任何提示了

commented

请确定 terminal 能访问
比如 curl google.com

请确定 terminal 能访问 比如 curl google.com

我是可以访问的

请确定 terminal 能访问 比如 curl google.com

刚才试了一下 挂着代理也访问不到,什么原因如何解决大佬

commented

进入 python repl
看看是否能调用 openai 接口试试?

进入 python repl 看看是否能调用 openai 接口试试?

已经尝试可以调用,一开始我使用小爱的时候报错

问题:你是谁?
以下是小爱的回答: 你大哥
以下是GPT的回答: HTTPS proxies https://127.0.0.1:10809 are not supported, ignoring
GPT回答出错 Error communicating with OpenAI

然后我改了代理 set http_proxy=http://127.0.0.1:7890 & set https_proxy=http://127.0.0.1:7890 再用的时候就直接
GPT回答出错 Error communicating with OpenAI ,然后没有其他信息了

commented

看起来是你的 ip 被 openai block 了

看起来是你的 ip 被 openai block 了

我出现同样的问题 但是测试了我自己用openai.ChatCompletion.create可以拿到答复

commented

问题:写一首诗?
以下是小爱的回答: 嗯哼~我先写首普通的诗热热身
以下是GPT的回答:

GPT回答出错 Error communicating with OpenAI

直接 curl https://api.openai.com/v1/completions 是有反应的

curl https://api.openai.com/v1/chat/completions \ -x socks5h://127.0.0.1:13659 \ -H "Content-Type: application/json" \ -H "Authorization: Bearer sk-xxxx" \ -d '{ "model": "gpt-3.5-turbo", "messages": [{"role": "user", "content": "Hello!"}] }' {"id":"chatcmpl-7O0lVLOMrLNsSfpQgh5OI42BdpLka","object":"chat.completion","created":1685957169,"model":"gpt-3.5-turbo-0301","usage":{"prompt_tokens":10,"completion_tokens":10,"total_tokens":20},"choices":[{"message":{"role":"assistant","content":"Hello there! How can I assist you today?"},"finish_reason":"stop","index":0}]}

image

在 wsl 跑 proxy 得设置成 wsl 的 ip

commented

image

在 wsl 跑 proxy 得设置成 wsl 的 ip

有兴趣提个 PR 加在 README 里么?

正好没啥事,好。

image
在 wsl 跑 proxy 得设置成 wsl 的 ip

有兴趣提个 PR 加在 README 里么?

image

加在注意这个位置吗?

commented

可以。加在这没问题

pr 已提