# Generative AI {.unnumbered} 

Generative AI is a catchall term for models that can produce output similar to data they were trained on. Most notoriously of late, these include the large language models such as Chat GPT that can simulate conversation.

The ultimate utility of these models is yet to be realized in most domains. However, they are already quite useful for generating computer code, given careful use and supervision. If nothing else, they offer a sort of intelligent autocomplete that can assist you when you have forgotten the names of functions and the orders of their arguments.

For students, there is a sophisticated code-oriented AI that you can use for free: [GitHub Copilot](https://copilot.github.com/). It is a plugin for the free [Visual Studio Code editor](https://code.visualstudio.com) that is well-developed for use with most computer programming languages, including Python, Matlab, and Julia, and it can work with Jupyter notebooks natively. 

## Getting started with GitHub Copilot

1. Sign up for a free [GitHub account](https://github.com).
2. Apply for [GitHub Global Campus](https://docs.github.com/en/education/explore-the-benefits-of-teaching-and-learning-with-github-education/github-global-campus-for-students/apply-to-github-global-campus-as-a-student) as a student. This requires uploading some validation of your student status, such as a student ID or bursar's receipt. **It may take some time for your status to be verified.**
3. Download and install [Visual Studio Code](https://code.visualstudio.com).
4. Install the [GitHub Copilot](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot) and the [GitHub Copilot chat](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot-chat) extensions for Visual Studio Code. You may need to restart or reload VS Code after installing these extensions.
5. [Sign in to your GitHib account](https://itsfoss.com/vs-code-github/) in Visual Studio Code. 
6. Finally, open the GitHub chat window by clicking on the speech bubbles icon along the left side of the window. If it shows a button for starting a 30-day free trial, go ahead and click that, which takes you to a website. If your student status has been approved, yopu should *not* get asked for payment information before getting to a success screen. After one more restart of VS Code, you should be good to go.

## Usage

There are now several ways you can interact with Copilot:

- Open or create a code file and start typing. You will soon start to see grayed-out suggestions from Copilot. You can accept these suggestions by pressing `Tab` or `Enter`. If you continue typing, the suggestions will change to match. Note that Copilot will use the open file as context for its suggestions, including comments and variable names.
- Within your code file, you can type `Ctrl`+`i`, or `Cmd`+`i` on a Mac, to open the Copilot panel. You can type in the panel to ask questions or create a prompt for it to respond to.
- Along the left side of the VS Code window are icons representing the extensions you have installed. The Copilot Chat icon is a pair of speech bubbles (though this can change). Clicking on this icon will open a chat window. 
- You can use `Ctrl`+`Shift`+`P`, or `Cmd`+`Shift`+`P` on a Mac, to open the command palette and type "Copilot" to see a list of commands you can use to interact with Copilot. For example, you can ask Copilot to generate a function definition or a class definition, or to complete a line of code.