Tuesday, October 3, 2023

[Video] Configuring CodeGPT to use Azure OpenAI key

If there is a way to get GitHub Copilot, use it and don't look back. But if we don't have the luxury to afford the license or there are other reasons but still want to leverage AI continue reading this post.

CodeGPT VS Code extension

This is not a complete replacement for Copilot but it can give some level of intelligence and speed up development. Checking code quality, and explaining the code are some to use.

They have their own licensing model where the AI comes from them or we can use their extension to use our preferred AI providers. If we don't have GitHub Copilot but have an Azure subscription with Azure Open AI service we can configure the CodeGPT extension using the key from Azure Open AI.

Why this post and a video just to configure?

It may sound easy. Why a post to do the configuration? The reason is that the provided documentation¹ is not clear and the extension configuration screen leads us to the wrong URL to configure.
eg: the extension configuration screen is not showing the /openai/ in the URL also the fragment is to be added after the model name. But in order to configure we need all.

The endpoint of the Azure OpenAI service will look like below.

https://<your name>.openai.azure.com

But this is not the URL to be used to configure. The URL to configure is as follows

https://<your name>.openai.azure.com/openai/deployments/<model name>/chat/completions?api-version=2023-07-01-preview

Yeah, there is a video also made to make it simple.


References

No comments: