VSCode ChatGPT Extension (Optimize and Fix Bugs with GPT 4 in Visual Studio Code)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys in this tutorial I'm going to show you how to use chat gpt4 vs code extension also known as Visual Studio code now first thing you want to do is go to the extensions and type chat topt now I'm going to install the first Chad GPT extension on the list so just go ahead and click on the extension and then click on the install button you're going to need an open AI account and if you scroll down here in the extensions description you're going to see on this link we're going to use this link to generate your API Keys you can also find this link in the description of this video but before we go to this link I'm going to open a new vs code project so I'm going to go to my C drive projects and here I already prepared chat GPT project folder for this tutorial so I'm going to go ahead and open it in this vs code project I have a one file gpt.javascript and it's just a function that calculates a palindrome because we have charge apt extension installed right clicking on selected function will give you these two options chat GPT ask why code isn't working and Chad GPT ask to explain code clicking on one of those options will ask you for your open AI API key now it's time to go to that link in the description of this video here click on the button to generate your key now open AI does not share your keys so this is your only opportunity to generate and copy the key now let's go back to vs code and here we're going to paste this API key into this box go ahead and press enter in your charge GPT action is going to execute in a split window now this is not the only chat GPT extension for visual studio code so I'm going to go ahead and go back to extensions type chat GPT again and install the second extension on the list it's very similar to the first chat GPT extension but it seems to have better features now the way you set it up is press Ctrl shift p and I think it's command shift B on a Mac this is called command palette in vs code and just start typing chat GPT now to be more specific type update API key now we're going to enter our API key into this second extension we just installed press enter to validate your API key now go ahead and close everything except the Javascript file select the function right click and in this area right here you'll have your chat GPT options why is there a bug in this code help me explain the code refactor this code custom prompt which is what allows you to ask your own questions I'm going to go ahead and select help me explain the code as soon as you do that you'll see Chad GPT explaining the code line by line so this is a great way to learn how to code now in this prompt that appears you can ask your own questions so here I'm going to ask jagpt to optimize is palindrome function one interesting thing here is that you have to be very specific because here it started to optimize the function using the Python language so you have to be more specific and here I'm going to type optimize is palindrome function in JavaScript and the chat GPT is going to proceed making this function a lot shorter now don't try to right click on the function and copy it it's just not going to work took me a while to realize is the proper way of doing that is clicking on this copy button next to the code block so that's it for this tutorial we installed a chat GPT vs code extension entered our open AI key which makes this charger PT extension not free so be careful how you use your tokens and finally we use the cha GPT extension to optimize the JavaScript function
Info
Channel: Ghost Together
Views: 22,616
Rating: undefined out of 5
Keywords: chatgpt, vscode, visual studio code, extension, optimize, explain, fix bugs, code, javascript, python, api key
Id: UuWwIhHY9oE
Channel Id: undefined
Length: 4min 27sec (267 seconds)
Published: Wed Jun 14 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.