In this tutorial, we will learn about how to install ChatGPT in VS Code using 8 steps. ChatGPT and CodeGPT are designed and developed by OpenAI which is an AI research and deployment company. Even though ChatGPT and Code GPT are based on the same GPT (Generative Pre-trained Transformer) architecture, there purpose are different and they are trained on different datasets.
ChatGPT is a language model which was designed back in 2018. It was in 2018 when first version of ChatGPT ( GPT-1) was released. Today the most latest version GPT-4 is available for use. ChatGPT was designed with an intention to generate human-like responses for any real time inputs. It was trained on large datasets to make the model response like human for any given input.
How to Install ChatGPT in VS Code [8 Steps]
There could be possibility that not all version of VS Code supports the ChatGPT plugin. I have also shared the steps below to upgrade the VS code version if existing version doesn’t support the ChatGPT plugin. Please follow the steps given below.
- Must have VS Code Installed
Step-1: Search CodeGPT Plugin
In this step, Open VS code IDE and go to Extensions tab from left Panel. After that search for CodeGPT Plugin as shown below.
Step-2: Install CodeGPT Plugin
In this step, Click on CodeGPT plugin and hit the Install button to install the plugin as shown below.
Step-3: Update VS Code
In this step, If you see below error while installing the CodeGPT plugin, please upgrade the VS Code version.
To upgrade the VS Code version, Click on Help-> Check for Updates as shown below.
Next, a pop up will appear at the bottom right corner. Click on Install Update to install the latest VS Code version as shown below. Once done, restart the VS Code to apply the changes.
Step-4: Install CodeGPT Plugin
In this step, after upgrading the VS Code IDE version, Install the CodeGPT plugin as shown below.
Step-5: Login to openai portal
In this step, open openai.com. Next, lick on Developers -> API Reference as shown below. it will redirect you to the API reference document page as shown below.
Next, click on the Log in button (if you have an existing account) or Sigh up button (To create a new user account). Provide your email id and password to sign up as a new user and configure your account.
Step-6: Generate new API Key
In this step, after successful login to OpenAI site using above created credentials, you will see an option to View API Keys. Click on it as shown below.
Next, click on Create new secret key to generate a new secret key as shown below.
Next, give a name to the key and then Click on Create secret key as shown below.
A new key will be generated. Copy the key and save it somewhere in your local. We will use this key in the next step to integrate in VS Code.
Step-7: Configure API Key in VS Code
In this step, go back to VS Code and click on Settings as shown below.
Next, in the search bar, search the keyword CodeGPT and paste the API key as shown below. Close the setting tab after pasting the API key.
Step-8: Test Working of ChatGPT Plugin
In this step, after integrating the API Key, you will see CodeGPT plugin symbol as shown below. Click on the symbol as shown below.
Next, type any question in the GPT3 search box. For example, I have typed “create python code to build QR code”. In response, GPT3 will give the code snippet along with explanation of what the code does. You can now copy paste the same code snippet and verify the working.
In this tutorial we learnt about how to integrate ChatGPT in VS Code. By integrating ChatGPT plugin, you can create or ask any question and in response you will get suggestion and fixes based on your real time input. It becomes helpful to use GPT3 in fixing the code bugs in VS Code. You can also paste the code which has the bug and ask GPT3 to fix it for you. You can learn more about chatGPT from OpenAI official document.