ChatGPT in VSCode 🀯 - Your 10x Coding Partner (Tutorial)

ChatGPT in VSCode 🀯 - Your 10x Coding Partner (Tutorial)

Introduction to GitHub Copilot X and Visual Studio Code Extensions

In this section, the speaker introduces GitHub Copilot X, an advanced version of GitHub Copilot that integrates chat GPT functionality. They also mention Visual Studio Code extensions as an alternative while waiting for access to GitHub Copilot X.

GitHub Copilot X

  • GitHub Copilot has been a time-saving tool for the speaker in coding.
  • GitHub recently announced GitHub Copilot X, which integrates chat GPT functionality into it.
  • The speaker signed up for GitHub Copilot X but has not yet received access.
  • Access to GitHub Copilot X is currently limited.

Visual Studio Code Extensions

  • While waiting for access to GitHub Copilot X, there are several free Visual Studio Code extensions available.
  • The speaker reviews a specific extension called Chat GPT Genie AI.
  • There are other extensions available in the marketplace that can be explored.
  • Chat GPT Genie AI requires a ChatGPT API code and currently supports GPT 3.5.

Exploring Chat GPT Genie AI Extension in Visual Studio Code

In this section, the speaker demonstrates how to use the Chat GPT Genie AI extension in Visual Studio Code.

Interface Overview

  • On the left side of Visual Studio Code, there is a Genie icon representing the extension.
  • Clicking on the icon opens up the interface with six buttons.

Functionality of Buttons

  1. ADD tests:
  • Highlights code and automatically generates tests for it.
  1. Find problems:
  • Highlights code and identifies bugs or potential edge cases.
  1. Optimize code:
  • Simplifies complex code by reducing its length while maintaining functionality.
  1. Explain code:
  • Provides explanations of methods or files in a codebase.
  1. Add comments:
  • Allows adding comments to code.
  1. Write code:
  • Provides suggestions for writing code, similar to GitHub Copilot.

Using Chat GPT Genie AI to Explain Code

In this section, the speaker demonstrates how Chat GPT Genie AI can be used to explain and simplify code.

  • The speaker has a Ruby on Rails codebase as an example.
  • They highlight a specific piece of code and ask the extension to explain it.
  • The extension accurately explains the purpose of the highlighted code using natural language.
  • The speaker mentions that Ruby's meta programming nature can make code complex, but Chat GPT Genie AI understands it well.

Simplifying Complex Code with Chat GPT Genie AI

In this section, the speaker shows how Chat GPT Genie AI can simplify complex code.

  • The speaker highlights a file called "Associated public IDs" containing meta programming.
  • They ask the extension to explain the highlighted code, which it does accurately.
  • Then, they click on the optimize button to simplify the complex part of the code.
  • The extension successfully reduces 45 lines of code down to 21 while maintaining functionality.

Identifying Potential Issues with Code

In this section, potential issues with the highlighted code are identified using Chat GPT Genie AI.

  • While there are no syntax errors in the highlighted code, there are some potential issues identified by the extension.
  • One issue is related to using object.cons method for getting class names, which may be dangerous if provided by users. A more secure method like module.cons is suggested.
  • Another issue is using the Define method method for dynamically creating methods, which can be difficult to debug and maintain. A more explicit approach is recommended.

The transcript does not provide further sections or timestamps beyond this point.

Writing Tests for Code

In this section, the speaker discusses writing tests for code and highlights a specific test using the "assert equal" function.

Writing Tests

  • The speaker mentions that they have just read something that taught them something new about writing tests.
  • They highlight a test in the code and label it as "ADD test."
  • The test uses the "assert equal" function to compare the company public ID from the customer model with the company's public ID.
  • The purpose of this test is to ensure that both values are equal.

Temperature Options and Prompts

This section focuses on temperature options and prompts in Chachi PT.

Temperature Options

  • There are three options for temperature in Chachi PT: precise, balanced, and creative.
  • Temperature controls how adventurous or creative the prompt responses will be from Chachi PT.
  • The values for temperature range between 0 and 1.
  • The speaker mentions that precise may correspond to 0, balanced to 0.5, and creative as another option.

Prompt Shortcuts

  • There is a star button that allows users to create shortcuts for different prompts.
  • Clicking on this button enables users to save cool prompts for future use.

Setting Context for Prompts

This section discusses setting context for prompts in Chachi PT.

Limitation of Context Setting

  • The speaker points out a limitation with setting context for prompts in Chachi PT.
  • Currently, users can only set the context based on what they highlight in their code.
  • If they want to set a broader context beyond what is highlighted, there doesn't seem to be an option available.
  • It would be beneficial to have the ability to set the context for the entire code base, allowing users to ask questions about the entire code base rather than just a specific file.

The speaker expresses uncertainty about whether this feature exists or not and hopes for it to be available in Chachi PT.

Video description

In this video, I review and give a tutorial for a ChatGPT extension in VSCode. This places ChatGPT 3.5 (and soon 4) in VSCode and the combination is magic. You can debug code, have it write code for you, DRY code, write tests, explain code, and so much more. If you want to be incredibly productive, you need to use this now. As someone who has been using Github Copilot for a while, this is a great addition and important to use before Github Copilot X comes out. Join My Newsletter for Regular AI Updates πŸ‘‡πŸΌ https://forwardfuture.ai/ My Links πŸ”— πŸ‘‰πŸ» Subscribe: https://www.youtube.com/@matthew_berman πŸ‘‰πŸ» Twitter: https://twitter.com/matthewberman πŸ‘‰πŸ» Discord: https://discord.gg/xxysSXBxFW πŸ‘‰πŸ» Patreon: https://patreon.com/MatthewBerman Media/Sponsorship Inquiries πŸ“ˆ https://bit.ly/44TC45V My Workstation Setup: Apple MacBook Air M2 - https://amzn.to/3GQFexg LG Ultrawide 5k Monitor - https://amzn.to/3XsnBuC Logitech Litro Glow - https://amzn.to/3HkP1wX Vivo Monitor Stand - https://amzn.to/3Xv0TlU Logitech MX Master S2 - https://amzn.to/3kyghiH Logitech Craft Wireless Keyboard - https://amzn.to/3QSsHhx Logitech HD Video Camera - https://amzn.to/3XMFFQc Blue Yeti Microphone - https://amzn.to/3XICOaP Uplift Standing Desk - https://amzn.to/3XMFYKQ Apple AirPods Max Headphones - https://amzn.to/3XOwYF1 Large Black Desk Pad - https://amzn.to/3YdNChz