ai-genie / chatgpt-vscode

Your best AI pair programmer in VS Code
https://marketplace.visualstudio.com/items?itemName=genieai.chatgpt-vscode
ISC License
1.11k stars 70 forks source link

401 Error in Editor View with Azure OpenAI gpt-4o #168

Open hkthirano opened 2 weeks ago

hkthirano commented 2 weeks ago

Verify it's not a duplicate bug report

Describe the Bug

After setting the URL and key for Azure OpenAI gpt-4o, a 401 error occurs in the Editor View.

This error does not occur under the following conditions: After launching VS Code, using the Conversation View first and confirming a response, then using the Editor View.

This error does occur under the following conditions: After launching VS Code, using the Editor View first without using the Conversation View.

I suspect that there might be a bug in the process of creating the connection instance to OpenAI.

Please tell us if you have customized any of the extension settings or whether you are using the defaults.

{ "genieai.azure.url": "https://your-endpoint-base.openai.azure.com/openai/deployments/your-azure-model-name/completions?api-version=2022-12-01", "genieai.openai.model": "gpt-4o" }

Additional context

No response

genieai-info commented 2 weeks ago

@hkthirano 401 error sounds odd. I tried to reproduce the bug using your steps but I don't see any issues. Could you please elaborate a bit on the detailed steps to reproduce the bug? A video walkthrough would be perfect.

Also make sure that you don't set the genieai.azure.url if you want to use OpenAI. That setting is only relevant if you have an Azure OpenAI service deployed. The setting url should point to your own deployment.

Remove this from your settings.json:

"genieai.azure.url": "https://your-endpoint-base.openai.azure.com/openai/deployments/your-azure-model-name/completions?api-version=2022-12-01",

hkthirano commented 2 weeks ago

I am sending a video that reproduces the bug. An error occurs in the editor view if you use it without interacting with the conversation view at least once.

We have set our custom Azure Open AI Service URL in genieai.azure.url. We have not set the ChatGPT URL.

https://github.com/ai-genie/chatgpt-vscode/assets/38097901/80c9dd9a-5032-41f7-9850-403c150d721a

martin-bmc commented 4 days ago

I have the same issue but with gpt-3.5-turbo-1106 in Azure OpenAI