AICommitApp / community

Streamline your coding process with AI-powered commit suggestions.
https://aicommit.app
MIT License
15 stars 1 forks source link

pycharm验证openai key连接失败 #10

Closed chenhui2016 closed 9 months ago

chenhui2016 commented 9 months ago

可否通过网页验证API key? 在pycharm中不能连接外网呀,总是连接失败~

rosuH commented 9 months ago

IDE 代理设置了吗?

chenhui2016 commented 9 months ago

image 成功了,但是我有chatgpt4,为什么显示不存在呢

rosuH commented 9 months ago

image 成功了,但是我有chatgpt4,为什么显示不存在呢

我待会确认下

chenhui2016 commented 9 months ago

可以修复的话 辛苦回复我一下呀~

rosuH commented 9 months ago

可以修复的话 辛苦回复我一下呀~

其他 gpt4 模型可以用吗?

chenhui2016 commented 9 months ago

都不可以诶! 我的chatgpt买了gpt4了 image

rosuH commented 9 months ago

@chenhui2016 似乎 API 的 GPT4 不依赖 GPT Plus。你执行下下面的 cmd,看看能不能得到正确响应,记得替换掉 key

curl https://api.openai.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -d '{
    "model": "gpt-4",
    "messages": [
      {
        "role": "system",
        "content": "You are a helpful assistant."
      },
      {
        "role": "user",
        "content": "Hello!"
      }
    ]
  }'
chenhui2016 commented 9 months ago

OK 多谢,解决了 gpt4的key还是单独买