nicepkg / aide

Conquer Any Code in VSCode: One-Click Comments, Conversions, UI-to-Code, and AI Batch Processing of Files! 在 VSCode 中征服任何代码:一键注释、转换、UI 图生成代码、AI 批量处理文件!💪
https://aide.nicepkg.cn
MIT License
2.13k stars 132 forks source link

Connection error no matter what ip I use #46

Open Kriston-12 opened 1 month ago

Kriston-12 commented 1 month ago

I am 100% sure I set all config appropriately with my openAI. I have the connection error after a while of a loading bar showing Aide is processing--it can not process it properly

Kriston-12 commented 1 month ago

I tried to use my base url (https://api.openai.com/v1) in my browser, it does not work at all--status code 404. Then I changed my url to https://api.openai.com/v1/models, it returns a json object showing "You didn't provide an API key. You need to provide your API key in an Authorization header using Bearer auth (i.e. Authorization: Bearer YOUR_KEY). You can obtain an API key from https://platform.openai.com/account/api-keys." -- even though I already set the key in the extension config

2214962083 commented 1 month ago

Make sure you can access openai.com in your browser and can successfully ping openai.com in the command terminal. If you're using a proxy, it often only works for the browser and not for the terminal.

In this case, you can set the system environment variable HTTPS_PROXY = http://127.0.0.1:xxx where xxx is your proxy port.

If you're using Clash, the default port is 7890, so it would be HTTPS_PROXY = http://127.0.0.1:7890, If you're using Clash, remember to turn on the TUN switch in the Clash settings, then try again.