Add ChatGPT functionalities within Visual Studio

What is Visual chatGPT Studio?

The Visual chatGPT Studio is a free extension for Visual Studio that adds chatGPT functionalities directly within the IDE. It allows users to consult the chatGPT in two ways- directly through the text editor or through a new specific tool window.

You can download it as an extension from the Visual Studio Marketplace.

Features in the text editor

The extension provides a set of new ChatGPT commands that can be accessed by selecting a method and right-clicking on the text editor. These commands include asking for complete, creating unit tests, finding bugs, optimizing, explaining, adding comments or Summaries for C# methods, asking anything, creating custom commands, and replacing selected text.

  1. Complete- Write a method, select it, and ask for completion.
  2. Add Tests- Create unit tests for the selected method.
  3. Find Bugs- Find bugs for the selected method.
  4. Optimize- Optimize the selected method.
  5. Explain- Write an explanation of the selected method.
  6. Add Comments- Add comments for the selected method.
  7. Add Summary- Add Summary for C# methods.
  8. Ask Anything- Write a question on the code editor and wait for an answer.
  9. Custom Before- Create a custom command through the options that insert the response before the selected code.
  10. Custom After- Create a custom command through the options that insert the response after the selected code.
  11. Custom Replace- Create a custom command through the options that replace the selected text with the response.

Setup the Visual ChatGPT Studio extension

  1. Under Visual Studio, go to the “Extensions menu”.
  2. Click on “Manage Extensions”.
  3. In the search bar, search for “Visual ChatGPT Studio”.
  4. Select the extension from the search results and Download it.
  5. Once the download is complete, the extension should be installed automatically.
  6. Restart Visual Studio.

Before using the extension, you must “Create new secret key” from

https://openai.com/product

  1. Under Visual Studio, go to “Tools” and then “Options”.
  2. In the “Options” categories, select “Visual chatGTP Studio”.
  3. Enter the key into the “OpenAI API Key”. Once you get the secret key, Copy it and store it.
    ChatGpt image

How to use the extension in Visual Studio?

Select a code block and right-click the mouse to show the Visual ChatGPT  Studio commands.

Below is an example of the features- Explain, Add Comments, Add Summary, and Add Tests.

Disclaimer

  • As this extension depends on the API provided by OpenAI, there may be some change by them that affects the operation of this extension without prior notice.
  • As this extension depends on the API provided by OpenAI, there may be generated responses that not be expected.
  • The speed and availability of responses directly depend on the API provided by OpenAI.

Summary

I hope this article helps you understand the installation and use of Visual chatGPT Studio extension installation within Visual Studio.

Thank you for reading; please let me know your questions, thoughts, or feedback in the comments section. I appreciate your feedback and encouragement.

Happy Documenting!