Purpose: In this lab, we'll show how you can use GitHub Copilot Chat to get answers to programming related questions without leaving your editor.
- Use the chat interface to ask a question about a programming topic. For example, you can ask about the latest version of a programming language, how to use a specific function, or how to solve a specific problem. Enter the question below in the chat interface.
What is the latest LTS version of Node.js?
The response is based on the information available to Copilot at the time the models were trained. There may be a link to an online source for the most current information, e.g. official Node.js website
.
As of June 2024, there is a new GitHub Copilot Enterprise feature: GitHub Copilot Enterprise can now search Bing within chat conversations in VS Code to answer questions and find information outside of its general knowledge or your codebase. To get answers enriched with Bing search results, start your message with @github
. Copilot will intelligently decide when to use Bing. This feature is CURRENTLY ONLY available in GitHub Copilot Enterprise so, the presenter will show you how this works as this is not available in GitHub Copilot Individual.
- Let's try using
@github
to get an answer based on a Bing search. Enter the question below in the chat interface.
@github What is the latest LTS version of Node.js?
This response is enriched with Bing search results. You can use this feature to get answers to questions that are not covered by Copilot's general knowledge or your codebase.
- Let's see if we can use
@github
to learn about the advantages of using GitHub Copilot. Enter the question below in the chat interface.
@github Why is GitHub Copilot better and more secure to use than prompting ChatGPT and copy/pasting the code back into my IDE?
Does the response help you understand why GitHub Copilot is better and more secure to use than prompting ChatGPT and copy/pasting the code back into your IDE?
- Learn how to get started with the Azure OpenAI Service
You can leverage the Azure OpenAI Service to build your own copilot and generative AI applications. But, how do you get started? Let's ask GitHub Copilot. Enter the question below in the chat interface, be sure to replace [language X]
with the language you are most likely to use, e.g. JavaScript
or, Python
or, Java
, etc.
@github We use [language X] for application development. How would I get started with Azure OpenAI?
This provides a wealth of information. To save the response, right-click anywhere in the response and select Copy
. Now you can paste the response somewhere that you can reference later such as a GitHub Issue or, a GitHub Discussion post.
- While we can use
@github
to get answers to programming questions, we cannot use GitHub Copilot Chat to ask general questions. For example, you cannot ask about the weather or the latest sports scores. Enter the question below in the chat interface.
@github Who won the Super Bowl in 1986?
That's ok. Everyone knows that the Chicago Bears won Super Bowl XX in 1986. 😉