AI Engineer World's Fair 2024
GitHub Copilot - The World’s Most Widely Adopted AI Developer Tool (Repeat)
About this talk
Christina Warren and GitHub colleagues lead a repeat hands-on GitHub Copilot workshop covering repository setup, browser-based GitHub Codespaces, contextual IDE suggestions, Copilot Chat, and workspace-aware chat participants. Demonstrations address precise prompting, inline ghost-text completions, extensible chat participants and models, enterprise knowledge bases, and managing issues and pull requests from Codespaces. The recorded introductions identify an assisting presenter, Harald, who is absent from the authoritative scheduled roster, while scheduled presenter Dimitrios Philliou is not identified in the supplied transcript excerpts.
Chapters
- 0:00Workshop introduction, presenters, and repeat-session context
- 1:14Workshop repository, Copilot overview, and contextual assistance
- 22:48GitHub Codespaces setup and Copilot Chat participants
- 34:01Hands-on coding labs and ghost-text completions
- 57:03Audience questions, extensibility, and enterprise knowledge bases
- 1:13:33Copilot Workspace questions and Codespaces pull-request workflows
Talk transcript
- 0:00
[upbeat music] Well, I hope that everybody, um, has had a great first half of your day, uh, so far and had a good lunch.
- 0:19
Thank you all for being here. Um, this is a talk, this is gonna be a workshop, uh, about, uh, the world's most widely adopted devel-- AI developer tool, and that of course is GitHub Copilot.
- 0:30
I'm Christina Warren. I'm a senior developer advocate at GitHub, and I'm going to be assisted today in this workshop by my colleagues Dave, Alex, and Harald, who are all here in the front.
- 0:41
Uh, and, and well, um, um, uh, Alex is in the back, so we, we've got people, um, sorted around. Um, we did a version of this workshop earlier, um, this morning.
- 0:52
Uh, this is gonna be our second, uh, uh, try at it. We learned some things, so we'll see how things go. Um, and then as we go along, if you have any questions or if you need help, um, w- I will have some resources where you can, um, get help, um, online in, in GitHub, but also feel
- 1:05
free to raise your hand, and we will do what we can to help you out. And, uh, this is just kinda gonna be a little bit of an overview of how we're going to be doing this today.
- 1:14
So we're gonna start off with an overview of GitHub Copilot, and then we're going to talk about, uh, getting set up and, and access, um, for the, the repository that we'll be working out of and, um, getting access to GitHub Copilot if you don't already have access.
- 1:29
Um, I would love, just out of curiosity, uh, for the people in the room, how many of you have used GitHub Copilot before?
- 1:36
Okay. Awesome. Awesome. Um, that's great to see. Um, we also will have, um, uh, some resource links, um, then we're gonna get into the labs, and then of course, we will be doing some feedback.
- 1:47
This right here, this QR code, and I'm sorry that I was not able to make the URL larger, but this is, um, going to be kind of ground zero for this workshop, this repository.
- 1:58
So, um, if, if you wanna follow along with us, going to this, uh, URL, gh.io/aifair-workshop, is going to take you to a repository which will show you everything that you need, um, to, uh, to get, uh, is in this repository.
- 2:17
This slide deck is also in that repository, so if there's anything you want from that, um, that, that has been, um, added to that as well. But this is gonna be our central resource and where we're going to be working.
- 2:28
Um, I will have this up again, um, a little bit, uh, later, but if you wanna go ahead and, um, either, either go to this URL now or use the QR code, that would be great.
- 2:41
All right. So let's just do a little bit of an overview about GitHub Copilot, which is your AI pair programmer. Okay. So GitHub Copilot is, um, an extension. I mean, well, it works in multiple places actually.
- 2:55
Uh, we're, we're not gonna talk too much about the integration for, um, GitHub, um, Enterprise and, and some of the things we're doing on, on github.com. We're gonna primarily be focused on the, the experience inside your IDE.
- 3:07
Um, but, uh, this is, you know, one of the very first, uh, coding assistants. Uh, it was introduced in, uh, private preview in 2021, formally released in 2022. So we've been at this a while now, and basically, it's gonna be using the context that you provided, and then it's going to synthesize code to match that context.
- 3:26
And so using files that you have open, tabs that you have open in your editor, as well as comments that, that you're writing, or you can query directly with GitHub Copilot Chat in, in a chat interface to get coding suggestions, um, to, you know, convert comments into code.
- 3:43
So I can make a comment say, you know, "Write, write a function," um, to parse the URL, um, or to autofill for repetitive code if I'm using the same code block over and over again and the same pattern over and over again.
- 3:55
Uh, Copilot is going to know how to do that. It can also help streamline creating tests and show, you know, alternative ways of, of achieving, um, the same task.
- 4:06
And as I said, you know, this is your copilot for an AI-powered software development life cycle. Like, we're, we're taking place in the IDE and the terminal. Uh, we have support for Visual Studio Code, which is what we're going to be showing off.
- 4:18
Um, Visual Studio also has support for, for, uh, uh, GitHub Copilot, as well as a number of the JetBrains IDEs, and there's also a Neovim, um, extension, which, uh, I learned last, uh, session actually does have some GitHub Copilot chat support, which is cool.
- 4:35
Um, and, um, Copilot beyond that also can work on github.com. And so if you have an Enterprise account and have GitHub Copilot for Enterprise, there are different things you can do on github.com to also integrate, uh, w- with Copilot to aid in, in the creation of, of pull requests and in, um, uh, uh, fixing, um, potentially insecure
- 4:57
code and, uh, you know, uh, even we're going to have a session tomorrow with one of our colleagues kind of going from ideation of a, kind of an idea of, of how you wanna plan something out to actually implementing that whole plan.
- 5:11
Um, and so one of the questions that we get a lot is,
- 5:18
"Is Copilot training, uh, you know, the, the model on my, um, data?" And, and the answer to that, to my coding data, and, and the answer to that is no.
- 5:29
There is an option if you want to contribute- ... your, um, uh, code completion stuff into the larger model, but that can be turned off, and, and by default, that is off for business and enterprise accounts.
- 5:41
And so how this is working is we are actually just taking the context from the editor and, and, uh, my colleague Harald can talk a little bit more about how that's working and, and kind of getting an idea of what I'm doing.
- 5:53
That's going to be sending it to OpenAI's, uh, GPT model, and then sending suggestions back. Now, that model itself has been trained on public source cord, um, uh, source code and, and that's how that's gotten better.
- 6:07
But your code itself is, is not feeding, feeding our model. Um, there's an option, as I said, if you wanted to do that, but that, that is not how it works, um, by design.
- 6:18
Um, so some of the, again, some of the answers to the common questions. You know, "Does it, it train on my code?" No. When you're using it for, for business or for enterprise, none of your code i- is stored by GitHub, and even on the individual plans, there's an option to be able to, to turn that feature
- 6:33
off. Um, what is included in the context? So this is going to be the files that you're working on, and so that could be, you know, uh, tabs that are open in your IDE starting from the current file.
- 6:43
Um, and you know, another question we often get is, you know, "Can't I just, you know, write the code on my own?" Well, yeah, but how often have you ever been in a situation where you have to write the same piece of boilerplate code over and over and over again, and oftentimes doing the same thing with minor
- 7:00
changes? Uh, we love to automate ourselves out of jobs, make things easier on us so we can focus on things that we actually enjoy doing more, and this is one of the great things about, I think, AI and about, um, uh, coding assistants like Copilot in general.
- 7:15
So one of the features that we introduced, gosh, I guess it was
- 7:21
a year and a half ago now, is GitHub Copilot Chat, which basically brings kind of a ChatGPT-like experience into your editor. So you can actually chat directly inside your editor with Copilot, um, and, and you can ask questions.
- 7:36
You can also ask for specific queries about the code that is in your editor itself. So you can say-- you can select some code and say, "Hey, how can I optimize this?
- 7:44
How can I make this better?" Or, "Write me a b- a, a unit test for this code," and it can do that. You can also ask more general queries.
- 7:50
It's also great for being able to translate, you know, code from one language to another. Um, sometimes that actually works really well. Um, you'd be surprised. And um, it can also, you know, ask it to propose fixes for bugs and to help make code more secure.
- 8:06
And this support for Copilot Chat is in VS Code, Visual Studio, JetBrains, and as we learned recently, yes, um, Neovim. Um, how well it works in Neovim, I, I don't think all the, the features are quite there, but it is there.
- 8:21
And one of the things when we talk about... And, and we're gonna be getting to d- some demos in just a second. Uh, but one of the things that we talk a lot about when we talk about, you know, uh, coding assistants are, are prompt crafting, because a lot about how well these things works depends on what
- 8:36
prompts you're writing and, and what, um, information you're giving, um, Copilot. Because again, it is a copilot. It is not doing it for you. And so writing good prompts can help get better results.
- 8:51
And so some of the, the ways that we've seen that really improve, um, is by making sure that you have the right amount of context. This can be really useful.
- 9:03
A- again, like I said, having what, what tabs you have open, starting with, like, the, the, um, most recent file, um, or the centr- central most file rather, um, and, and what other files are open.
- 9:13
That can g- provide Copilot with context about what you're doing. Also, if you put things in a comment, um, about what you're trying to do, or even in some cases giving it, you know, an example of code that you want it to replicate or, or that, that represents what you're trying to achieve, that can go a long
- 9:30
way with helping Copilot understand what you're trying to achieve. Um, a- also being very clear about what your intent is and, and making that clear in your prompt. You know, "I, I want to create a function to parse a URL."
- 9:42
This is actually going to be one of the examples in the labs. Being very specific about what purpose you have in mind in that prompt. Being vague can work okay, um, but the more specific you can be, the better results you're going to get.
- 9:58
Um, also focusing on clarity, being easy to understand. That's going to also help the, the AI, uh, give better results. And being specific, and, and, and that means, you know, saying, "Okay, I, I, I don't want it to look like this.
- 10:12
I want it to look like this." So being, uh, detailed and precise will also go a long way, um, at getting the most out of Copilot. And the workshop that we have will go through all these different steps.
- 10:24
Yes.
- 10:25
Yes. Now we have time for questions.
- 10:27
Sure.
- 10:28
Uh, so regarding the context, is there any way to control it better? Like, I would assume that we want just to control...
- 10:36
So everybody can hear you from here.
- 10:37
Yeah.
- 10:38
Uh, so like the... Oh, okay.
- 10:44
Cool. Uh-
- 10:46
Can we get the second mic on?
- 10:47
Maybe it has below red.
- 10:57
Try that.
- 10:58
Sorry about that.
- 10:59
No, this is not your fault. There we go.
- 11:01
Okay.
- 11:02
All right.
- 11:02
There we go. Yay.
- 11:03
So the question was about, uh, the context that we provide to, to Copilot.
- 11:07
Mm-hmm.
- 11:07
Is there any way to have more control over it? So I assume that given the context length, that GitHub does some smart things underneath to, to kind of, uh, um, make it smaller.
- 11:20
So obviously it won't load all of the 10 full pages of 2,000 lou- lines of codes. Um, and sometimes it will give you subpar results because of that, because obviously it doesn't know the exact-
- 11:32
Right
- 11:32
... method that I have in mind right now. Um, so yeah, uh, how about that?
- 11:37
Actually, I'm, I'm gonna let, uh, my colleague Harald answer that question 'cause he's got, has way more insight into this than I do.
- 11:42
Second, uh, uh, there's also a talk tomorrow, I think at the Booth Theater. We're gonna go more into context as well. So there's an attach button. Once you open chat, you will see you can ac-actually reference files specifically.
- 11:54
Uh, so that's one way. Um, otherwise, the, the best surefire way, if you have code selected that you wanna talk about, Copilot will include it as long as it fits into the context window, and that's, that's kind of the, the best trick to keep in mind, just having code selected.
- 12:08
Same for inline chat as well, if you try that out. Um-
- 12:11
The attach button have been there for long?
- 12:14
No. No, it hasn't. It just came in the last release, so, uh, i- uh, uh, so it's a sneak preview to tomorrow's show. [laughs] Um, but otherwise, the [REDACTED:username], if you try that out, that's in the, in the plan as well.
- 12:25
That will give you a more general overview, uh, of your project, uh, using kind of rack techniques and, and giving context, uh,
- 12:35
re-related to the question. So the better you ask a question to code patterns that are actually in your code base, the more it will find. It will show you.
- 12:42
Ch- always check the references, uh, that are, that you see in chat to see what context is being used. So that's kind of the main, main tips there.
- 12:49
Yeah, and there's a question in the back.
- 12:51
Yeah, my voice not sure if you can. Yeah, sure. I'll just project. Uh, so, uh, to follow up on the question that was just asked, one of the things that I've, uh, dealt with is the same problem where it seems like I don't have the full context being loaded in when I ask questions.
- 13:05
Just a question on terms of best practice. If I reference a method that exists in another file, is that method still being loaded in in the context if I ask a question, or do I need to explicitly have that file open as a tab?
- 13:19
You can use the attach button there as well, and we're working on that you can also attach symbols from your code base. So that will be also possible.
- 13:27
And so as a best-
- 13:28
Yeah
- 13:28
... best practice then, I always need to bring in the additional context.
- 13:33
Yeah.
- 13:33
It's not smart enough to figure out that I'm calling a function from a different file.
- 13:37
Not, not yet. We're working on that as well. So that's, there's definitely more in-in-inference coming, but as that can easily go, go wrong, as for sh- given the broad s-- lots of questions people can ask.
- 13:47
So the, the more explicit... If you know what you're talking about, just show it to Copilot, just like you would do with anybody else.
- 13:53
But can you attach your whole folder or file by-
- 13:56
That's, uh, [REDACTED:username]. Yeah, so @, [REDACTED:username] is a, is a rack pattern where we look at the whole code base.
- 14:03
Yeah.
- 14:04
But it won't be fully in context then.
- 14:05
Yeah. Not, not the thing. Yeah.
- 14:08
Awesome. Awesome. Yeah, and if you, if you continue to have more questions, yeah, please just raise your hands, um, because this is great, and, um, we have really good people here to answer those questions.
- 14:16
Um, a-again, some additional, like, good best practices. Using good names. Sorry, go on. Yeah, David.
- 14:22
No, I was just gonna say one, one... We'll refer in a little bit to we've set up discussions, GitHub discussions, and similar question came up this morning. So we already have a set of links out there to dive into different resources to learn about exactly everything that Copilot pulls in for context.
- 14:43
You know, so from that, you can-- you've got some documentation and references to dig into, uh, to, to figure out in your situation, your situation, what's gonna work best.
- 14:53
Yeah. And, and also attend Harald's talk tomorrow too, um, because, uh, it, that, that, that, that is a plug for you, Harald. Thank you very much. Um, but yeah, um, um, just, just quickly going ahead.
- 15:03
Um, this, uh, this, uh, is linked in the main repo that I, that I linked to before. This is the Discussions tab, but this also goes directly there. So if you want to, um, if you have any questions during the workshop or if, if you wanna see some of the previous, uh, questions that were asked before, we've
- 15:17
got that stuff there as well. Um, so, um, again, just real quickly, some best practices in addition to offering context, because that is an important thing. Using good names, because Copilot is designed to understand natural language, so not being, you know, uh, using, uh, overly genericized things, actually giving things names the way you would actually name a,
- 15:39
a, a function or a class is useful. Spelling out variable names. You know, single letter variables and abbreviations can be ambiguous, so if you can spell those out and be specific with them, you can get better results.
- 15:50
Um, keeping functions functional, um, is, is, is a good thing too. And, and then the, the biggest thing, honestly, is being consistent. So, you know, the generated code is going to follow contextual patterns.
- 16:01
And so again, to what Harald was mentioning before, if you select some code and you can offer that as context specifically in addition to attaching code, um, that, that new, uh, feature that, uh, th- uh, just, uh, recently shipped, um, that will help, um, get better code too.
- 16:17
But, but yeah, I mean, good code does beget better code. And so one of, I think, the misnomers, um, about a lot of the coding assistance is that it's really primarily aimed at people who aren't, um, skilled developers.
- 16:30
And, and that's true that it can help people who don't have, um, a strong development background, but I think what we've found in the last three years is that the people who really get the most out of this are people who are developers day in and day out and who do work a lot with it because they
- 16:42
are, are getting the most, um, uh, use cases, uh, because they can be the most consistent and, um, are already, you know, um, committing, no pun intended, you know, many of the best practices.
- 16:53
Okay. Um, one of the other things too, and we're gonna go through this 'cause this is actually one of the fun parts of the workshop, is that, you know, if at first you don't succeed, you know, iterate.
- 17:01
Try and try again. That can be frustrating sometimes, certainly. Um, uh, we, we've all been there, where, you know, you, you get so close to getting something that you want and it's not quite there.
- 17:10
But at the same time, this can be a really great way of learning what sorts of prompts work well and what sort of prompts don't work as well. Um, and so, um, for instance, uh, in, in this image, uh, I'll just describe this.
- 17:22
Um, you know, the initial comment said, you know, "Write a JavaScript function that finds the maximum value in an array." And that's pretty broad. And so what the result is, is also fairly broad and, and generic and, and might not work for what you're wanting to do.
- 17:37
But the second prompt, by being more specific, by being more, um, intentional Create a JavaScript function, findMax, that takes an array and returns the string with the maximum length.
- 17:49
Ensure the function works correctly for arrays, um, as, as, um, that are embedded as well as arrays that contain both strings and numbers. That's gonna give us a much better result.
- 17:59
So these are, these are things that, again, being more specific with your, your comments, um, e-either in your code or with your queries to the chat agent, um, it can, can work really well.
- 18:08
And as you find things that work, you know, playing around with things and iterating is, is the best way of doing that. Um, another, another, uh, best practice is providing examples in your prompt to clarify what you want Copilot to do and what you want it to take into consideration.
- 18:26
So you can inside that, that prompt, you can, you can put some, some sample code and, and say, "Hey, consider this, this example data. I want it to work correctly for things like this."
- 18:40
That's something that, that the, um, AI can understand very, very well.
- 18:45
Uh, and, and then again, keeping files open that are relevant to the requirements of your current file, this is great. If you wanna call in other things from your broader code base, you can use the [REDACTED:username] agent.
- 18:55
Uh, but, but keeping those relevant files open, that's going to help, um, a-as well. Um, and, um, again, like, there are still going to be limitations by how much context everything can take in, but this is, this is getting better all the time.
- 19:10
Um, and then, you know, above all else, you know, just go with the flow. Uh, be open to things sometimes working, sometimes things not working, and, and experimenting.
- 19:19
Okay. All this is great. We've got a, you know, quick kind of overview. When can I write code? Well, we can, we can start to do that right now.
- 19:27
But the first thing we wanna kinda talk through is, is getting set up. And so again, this is our-- going to be our main, um, ground zero repo. So this is gh.io/aifair-workshop.
- 19:43
So if you wanna go to that repository now, that would be great.
- 19:50
Now, if you already have GitHub Copilot, um, if you already have access either on your personal account or through your company, that's all you're going to need to do.
- 19:58
But if you don't have GitHub Copilot, uh, we do have a coupon code that will give you access, and that is, um, going to be at this URL. That is actually linked on the repo.
- 20:14
It's one of the very first things linked in the repo, both, uh, as a, a, a physical link as well as a QR code. But if you wanna go ahead and, and scan this QR code, you can activate a coupon.
- 20:23
This will give you a seven-day free trial of GitHub Copilot. If you run into any problems getting this activated, what we did find last time, there are a couple of steps, um, after you enter in your information, um, where you will want to go ahead and, um, make sure you click Apply, I, I think like, like two
- 20:41
or three times. Um, this is what, what that-- it looks like. Basically, you're gonna click on Apply coupon, and then there's going to be another prompt to basically say Activate GitHub Copilot.
- 20:56
So we'll just give people some time here, and if you need to see one of the other screens, um, let me know about that.
- 21:07
And if anybody has any problems getting their coupons redeemed, please, uh, feel free to raise your hands, and we will send people out to do that.
- 21:18
This is that main repo, by the way.
- 21:23
And you just click on this link, which is in the repo. This should take you directly to
- 21:29
the page. I already have Copilot, so I don't need to do this. But, um, where you just need to fill out your information, and then you can go from there.
- 21:45
Give
- 22:23
people some time for that. And the next thing you're going to wanna do, um, um, after you've redeemed your coupon, and again, we'll, we'll, we'll, we'll, uh, make sure that we take time for, for, um, if anybody has any issues to get that set up, is in, again, this, this Copilot hands-on repo, you're gonna wanna go ahead
- 22:48
and, and fork this repo and make your own copy so that if you need to make any changes yourself, you can. But the more important aspect here is that to run this, this workshop, we are going to use a feature called the GitHub Codespaces.
- 23:03
Now, I am curious, how many people in the audience are familiar with GitHub Codespaces?
- 23:08
Way less. Um, okay, cool. So GitHub Codespaces are actually pretty awesome. Um, this is, uh, think about it as a virtual cloud environment. So basically, it is a pre-configured, um, a VM in the cloud that is set up specifically to have, um, certain features, um, that, uh, uh, that you've defined in, in your repository.
- 23:27
So there is a devcontainer.json file, which is basically kind of like a fancy Docker file, which will outlay- These are going to be the, uh, various dependencies and versions of the different things that we have installed specific to this repository.
- 23:43
Um, you can also designate what extensions in Visual Studio Code you wanna have installed, because we're going to be running that either in a, in a web browser instance, or you can open it up in the, the VS Code client as well.
- 23:56
Uh, it also works with, uh, with, with JetBrains, doesn't it? Um, uh, I, I believe, yeah. Um, but we're gonna be using VS Code today. And, um, this is just a really great way of, um, not having to bother with the process of setting up your environments.
- 24:10
Um, it instead can be configured exactly as, as it is in the repo rules. So in this case, um,
- 24:18
I've already forked my repo, so if... to get started, you want to just fork your own copy of the repository.
- 24:28
I've already done this, so I'm not gonna do this a second time. But, um, I... but, but, but I could. And, um, just go ahead and create fork. And once you've done that,
- 24:41
what we're going to do is click on this code button here, and there's a drop-down menu. And you have... you'll, you'll, uh, probably by default see local options. We're not going to do that.
- 24:52
If you wanted to do this locally, you could, but it's actually gonna be faster and, um, um, a, a little bit easier with Codespaces. Um, go ahead and, and click on Create Codespace on main.
- 25:03
And what this is going to do, this is gonna take a few minutes. This is going to create a... my case, this is wanting to open it in Visual Studio Code.
- 25:11
Um, I will actually fake that, um, because that's my editor preferences usually. Um, what it's going to do is it's going to spin up a VM. You could in, in another instance, uh, uh, Dave was talking about this, uh, before, and, and we could do a, a longer and different talk about how you could configure your Codespace
- 25:31
to, uh, have more cores and, and, and more RAM and, and be faster. But for the purpose of this demo, just the default is just fine. Also, with every GitHub account, you get a certain amount of, of free Codespace minutes, so that works great for us in these purposes too.
- 25:45
And what this is doing right now is this is basically Visual Studio Code, but in the browser. And so this is now spun up, um, a, a browser instance of VS Code.
- 25:55
Um, and it is setting up a remote con- um, uh, connection, and it is now building out this Codespace. So it is installing all the various dependencies, um, as, as defined in this dev container file, and, um, it is getting them ready, um, to, to run.
- 26:13
So just for anybody who might be curious, um, 'cause we will actually look at this a little bit later. But this is what that dev container file looks like.
- 26:21
And this is just a, a JSON file, and you can see basically that it is, um, installing, um, has certain, uh, settings set up for VS Code, including extensions for, um, you know, a code spellchecker, um, uh, the, the GitHub-style markdown preview, GitHub Copilot Chat, and GitHub Copilot, um,
- 26:44
as, as well as, uh, using an, an image, um, from, uh, a, a Docker image that, that had, uh, that's configured for, for, for Python, um, 3.11. So
- 26:57
this is now what the Codespace looks like. And so this is going to show how these things work. And what's interesting is it's going ahead and it's, it, it's installing these extensions.
- 27:05
And if I click on these extensions, you can see that right now
- 27:10
nothing is installed. But in a couple of minutes, uh, or hopefully moments, we will start to see our Copilot stuff come in, as well as our files. Yeah, here we go.
- 27:21
So now it, yeah, now it's just going ahead and it's, it's installing all of these extensions that we have access to. If you wanted to open this up in a local instance of VS Code, you could do that.
- 27:30
You would need to go ahead and manually install some of those extensions. That, that's the nice thing about doing it, um, in the, in the browser. And these are all the files that are from our repository.
- 27:40
So this is basically identical to what we were looking at before. Um, and actually,
- 27:49
one thing you might wanna do is... in that main repository that we, that we've been, uh, kind of focused on, at the very bottom, there is a labs document that says a Copilot hands-on lab.
- 28:04
Uh, this was a great tip, uh, that, that, uh, Dave had, and, and it's, um, it's in the documentation, but I'm gonna go ahead and do this here too.
- 28:10
If you wanna open that up in its own tab in your browser, um, and then maybe put it in its own window like, like so,
- 28:19
using, you know, whatever window manager you use. Um, I'm on a Mac, so window management sucks. Um, if you wanna tile it off to the left-hand side of your screen, um, and you can make that bigger or smaller, having this visible throughout the entire lab will be really, really good.
- 28:38
So that, that's, that's, that's one pro tip here. Um...
- 29:03
What did I lose? Okay. Again, I'm on a Mac, so windows man- wi-window management sucks. Um... [laughs]
- 29:22
I know, right? I know. You, we're finally gonna get some, some tiling management, hopefully. It's, it's, uh, it's ridiculous. Okay, and then there's this. Here we go. Great. Okay.
- 29:33
So I've now got these things configured that I have. This is my, um, uh, Codespace, and then this is my, my hands-on lab. Um, and at this point-
- 29:43
Um, on the bottom lower corner of your Codespace is this, uh, Copilot, um, uh, uh, icon, and you can see that the status is ready and that Copilot Chat has been, um, enabled.
- 29:55
Now, um, the chat window is here. This is the, the, the chat window, and in this way, I can either talk directly to the code base. I can also use-- there's a, an agents feature where I can talk directly to, for instance, I can, um, if, if I have a GitHub Enterprise account, I can use [REDACTED:username], and
- 30:15
I can ask questions about my, my GitHub account. These are primarily enterprise-related features. [REDACTED:username] is great. This will show you how to do things in your terminal. It's really, really good for FFmpeg commands and other things that you don't wanna memorize.
- 30:29
Um, and [REDACTED:username] will ask you questions in general about VS Code. It's also a really good way of kind of managing settings. And then [REDACTED:username], this is gonna be asking questions in general about the workspace that we have open.
- 30:42
So if you wanted to ask a more general question or, or to continue to add context from what you're working on, that's an agent that you can use using the chat extension.
- 30:53
So let me go back here for a second.
- 31:02
I'm just gonna put this back on screen for a minute.
- 31:08
These are the, the, the main links and resources. So the first thing is the Copilot coupon. Then we have the, the main repo where everything is taking place, and then we have the lab's, uh, README.
- 31:18
So these, these are kind of the, the main three things that we'll be working on. And if anybody has any, um, uh, problems getting access to anything, again, please raise your hand, and we will do our best to assist you.
- 32:07
Oh, yes.
- 32:09
Uh, I have a question on a feature.
- 32:11
Sure.
- 32:16
Yeah. Um, so a feature I want, um, a lot of times I do something, um, yeah.
- 32:29
What is the equivalent of the Control plus Enter to see the multiple, kind of, suggestions for the selected node?
- 32:41
Um, uh, what, what... Do, do you know, Harald? What, what, what's, what's the shortcut, um, on, on macOS to see the, the multiple, uh, the various code suggestions?
- 32:52
Command.
- 32:52
Yeah, I think it's just-- That's not working for you?
- 32:53
That is Control. So it's Control.
- 32:56
Oh, it's not. I didn't know.
- 33:05
It is.
- 33:11
Oh.
- 33:12
Thank you so much. That's nice.
- 33:34
All right. I lost connection to my Codespace because the demo gods are with me today, so this is reloading things. That's okay.
- 33:43
That's the, that's the one pratfall of using the, the cloud code environments is that sometimes they can, uh, run afoul. But in general, they work pretty well. So again, um, I've got my, my lab's, uh, hands-on stuff here, and we can just-- Once you've got this set up, we can go through the first lab.
- 34:01
Um, and this is a fairly, uh, basic one, so if, if this is something that you, um, uh, are still setting up, don't, don't worry about that. So the first thing that we're going to be doing
- 34:12
is creating a new file, in this case, an index.js file. So yes, we are using JavaScript in this example. Don't be afraid.
- 34:24
All right. Now, you will notice that it says I can press,
- 34:29
uh, in, in my case, Command + I, and I, I think that it's Control + I on Windows, where I can ask, um, a Copilot for something, or I can type a slash command.
- 34:39
Now, these slash commands are, um, ways that you can, uh, basically, um, I guess, simplify, um, certain operations with Copilot. So for instance, doing /doc will add a documentation comment around a symbol so that you can have a, you know, notice to go, go back and document your code more.
- 34:56
Um, /explain is actually really great. This is gonna explain how your code, um, in the active editor works. Um, and it's pretty good. There are some hallucinations, a-a-as there are with all LLMs, but it's, it's, um, pretty good, and it's, it's improved quite a lot even in, in just the last few months.
- 35:11
Um, that's one thing that I didn't mention earlier. Um, we are updating our, our Copilot model fairly frequently, and, and we're, you know, rebasing on, uh, you know, um, the
- 35:24
various versions of, of, uh, uh, GPT that, that come out from, from OpenAI all the time. But, uh, we are also then fine-tuning on top of that. And so the Copilot that i-if you first tried GitHub Copilot- A year ago.
- 35:37
You're going to get a different experience now, not just from the tooling perspective, but, but also in terms of the results because the models are getting better all the time and, and, and we're actively committed to, uh, improving those models all the time.
- 35:49
Um, slash fix will help you propose a fix, um, i- if there's a problem i- in your code. Um, a fix test failure will propose a fix for a, a failing test because writing tests is one of the best things of, of using a coding assistant.
- 36:04
And then again, slash test will help you generate unit tests for your selected code block. So
- 36:12
those are those options right there. All right. I've created this index.js file that I've got open.
- 36:22
Now, I just need to add a comment in my code.
- 36:38
And if I can spell correctly with one hand. Um, and, and if I can spell function correctly, that would be even better. Although, you will notice that, like, it actually, it picks up on typos fairly well.
- 36:48
Okay. So have this. By hitting Enter, the first thing that it's giving me is something,
- 37:00
something pretty minor. Um, and, and it is very similar to what, what, what our example says. Now, I can hit Tab, and I can accept this. Um, and, and this...
- 37:10
Uh, by the way, this, this text right here, um, see if I can zoom in on this more.
- 37:20
No, it is not letting me zoom while I'm in full screen. Great. Love you, um, Apple. Okay. Um, [laughs]
- 37:29
when you see this gray text here, this is what's known as ghost text, and, um, this is something that, uh, that, that Harald can actually talk more about. If you wanna maybe explain the different types of, of text and, and what other people see when they're using Copilot.
- 37:43
Yeah. Um, so I think, yeah, we, we start with completions, and that's the in the flow, you don't even think about it mode of Copilot. It always works, and when you get really used to it, you kind of ignore it when you're in the flow, when you're coding, when you know what you want.
- 37:59
And then once you want Copilot to kick in, you just wait a bit. It kicks in. You might even try different suggestions. You kind of flip through. Maybe you accept it word by word, and let's see what, how else it continues.
- 38:12
But it's really, you don't even think about it. And you notice then when you sit in the airplane and you stare at your screen for a minute, that you're in airplane mode and Copilot doesn't give you anything.
- 38:21
So that's when you know you build a habit. Then the other one is, uh, further next is inline chat, and that's where you, you can open up a little natural language input over your code, and that's where you can apply AI directly to your code.
- 38:36
And that's, in ChatGPT, you keep kind of having long-winded conversations about code, and that's where inline chat is much more powerful in giving a way, uh, quickly iterate on code to generate and edit both code.
- 38:48
And then lastly, chat panel is kind of the OG idea of ChatGPT in your VS Code, an editor chatting with context, being more in the exploration mode, where you wanna have conversations, where you wanna treat it like an A, uh, like an actual AI pair programmer which can challenge you, which, which can critique your code, where you
- 39:07
can go a little bit more back and forth and explore a solution. So these are kind of the three modes and when you wanna use them.
- 39:14
Awesome. Thank you, Harald. You're the best.
- 39:16
Follow-up.
- 39:17
Yeah, yeah, sure.
- 39:21
Um, I was just curious to know if there's a...
- 39:24
Thank you. I was just curious to know if there is a difference, um, you know, between the ghost text it generated here, um, so just doing it, you know, inline in the editor, versus if I was to have that function and then use the Control + I to say, "Write me the rest of this function."
- 39:40
Like, is there a difference in how the context is being provided to the underlying model? Is there any, like, reason we should use comments to get it to generate versus, uh, Control + I or chat in terms of-
- 39:49
Yeah
- 39:49
... context?
- 39:49
My, my personal take is you will see when code was generated with Copilot ghost text 'cause it has all these not very purposeful comments written in that very much describe the code below, which are not typical code comments.
- 40:03
You wanna describe, like, your reasoning and your thinking behind it, but that, that's not how you prompt craft with GitHub Copilot. So inline chat allows you to pull that prompt crafting into the inline chat and just get the code out and be more specific and elaborate in how you can describe it in that inline chat prompt.
- 40:20
So you, you're less iterating on the comment, but you iterate in a natural language input, which is sometimes more intuitive. So you will find if you, if you like writing long-winded comments and tweak on the comments and then hit Enter again and see what Copilot writes, that's basically a much faster, more direct flow with inline chat.
- 40:39
Yeah. That makes a heap of sense from a user, um, experience perspective. Just also keen to understand, is there a difference in terms of how that is being provided to the model between the two different ways of doing that?
- 40:48
Yeah, definitely. Uh, the, the c- chat, the ghost text is more grounded in the neighboring tabs. It has a much smaller context window because it needs to write it much quicker.
- 40:57
And then inline chat has way more freedom to include other context, dependency, documentation. So depending on which commands you're executing, it will do more work upfront to get context and more context.
- 41:09
Awesome. Thank you.
- 41:10
Yeah.
- 41:11
And there's a question in the back too.
- 41:13
Yeah, that was the question.
- 41:14
Okay.
- 41:14
Yeah. Fantastic.
- 41:16
Uh, no, it's just for me the, the, the inline one, uh, also kind of allows for
- 41:22
Awesome. Okay. And actually, just to, to show you here, there are these sparkles that come up, um, uh, where you will see certain things, and you can actually choose, uh, options to, like, fix using Copilot or explain using Copilot.
- 41:34
In this place, I'm just gonna show, uh, explaining. And this is just going to say, "Okay, this is the references using," and this is just, um-
- 41:47
Giving me, uh, a- an explanation of the nonexistent code that we basically have already kind of created at this point. So
- 41:56
going further through the, the, the lab, um, this is what it's going to generate now. Now, when you do create, uh, when you do get your code suggestion,
- 42:10
if you are not happy with, with what you're getting, there is...
- 42:21
You will sometimes be able to, to, um, uh, get other options, um, for, for other code suggestions. Um, but, but just kind of going through this, um, th- this, uh...
- 42:32
For instance, let me go on. Okay. So when I, when I press Control + Enter, and it is Control on both Mac and Windows, this is going to give me a list of suggestions here.
- 42:49
And so I have seven... I have, wow, I have eight different suggestions that all could be very, very different because, again, I gave it a really, really generic prompt, which goes to one of our first lessons we were kind of talking about.
- 43:03
Be specific. Be specific with what, what you want, uh, to achieve because I have eight different suggestions that all, all vary in, in what they're wanting to do. But this is one way that you can actually choose different suggestions.
- 43:15
So in this case, if I wanted to accept one of these suggestions, I could do that, and it's going to put those lines in place. Now, we are going to go ahead and, um,
- 43:27
not accept any of these. Instead, what I'm going to do is I'm going to...
- 43:53
Sorry. Typing with one hand is difficult. And you can see the ghost text coming up as I'm typing things out, so it's actually going ahead and putting further things here.
- 44:07
I don't actually want all of this, but I can just have this aspect here, and this is going to go ahead and p- potentially complete this, this code for me.
- 44:18
And if I wanted to select that, I just press the, the Tab key, and that's where this will come. And so basically, that's-- this is just our, our, our first lab.
- 44:26
This is just going through how this works. Um,
- 44:32
Harald, if you wanted to come up again and just you go, go through lab two, which we... I, I think I already showed off th- the bulk of it, but this might be, might be useful for folks.
- 44:42
Okay.
- 44:43
Harald, I did adjust it, so it should work now. [clears throat]
- 44:46
Okay, so no problem. Good. Let's go. Lab two. So, um, I think I showed it before. So once you're in ghost text mode, one good way, I just showed over here, is to hover the ghost text.
- 45:02
Everybody make some ghost text and hover it. [laughs]
- 45:07
That, that little widget gives you the right keyboard shortcuts and a little three dot menu on the end.
- 45:15
I'm gonna demo it here. This is why you're so... It's hard to type. [laughs]
- 45:25
I wish I had larger hands. Okay. So the classic is, uh, single line completions, and this, this, uh, especially in function bodies, Copilot will go into multi-line, which are easier to hover to.
- 45:41
In the top right, you now see the, the little widget which has one slash three and an accept, an accept word. So remember the accept word shortcut. That's a good keyboard shortcut to impress into your brain 'cause that lets you this...
- 45:57
lets you get out of this mode where you have to accept a whole function body that Copilot hallucinated for you, but start with the initial one that has the highest confidence.
- 46:07
We're like, "Yeah, that's the part I want." And then the rest I can work out with Copilot and fill in the rest as I figure out what I actually want.
- 46:16
But that's, that's one way. So hitting the Command + X or Command + Right, uh, that's one way. If you wanna do the c- full line, there's also... Come on.
- 46:27
I will do.
- 46:28
Yeah. It's so far.
- 46:29
What is this? Why is this so far away? Okay, so accept line is also here. Uh, if you wanna apply a shortcut to that, it's VS Code, so go, go, go ahead.
- 46:40
And then, but the other one is the open completions panel, which gives you this, this idea of more suggestions. Um, especially in multi-line, there's a lot more freedom for the AI to explore how it could solve this problem that it thinks you're having.
- 46:56
So these are usually a good way to understand your options.
- 47:00
And anything else missing? Then we have inline chat.
- 47:08
So the other way you can no- now solve this,
- 47:11
I can just take this out. So let's do a...
- 47:16
Just delete this, and then write. That's where I mentioned in, um, the panel, inline chat versus panel chat. Write a
- 47:27
URL parser function. And that's the mode where inline chat is used to generate code. Now, you don't start with a function body. You just give it an idea of what you wanna get out of it, and you just get a function that will parse the thing.
- 47:44
And actually, if I, I did this before with Copilot completions, and it got to the same conclusion. So you see how you can get to the same end result with different paths.
- 47:55
I could also give feedback now. Maybe this way, oh, it generated an A element. Maybe I wanna use a library for that. So you make sure you use that follow-up field to tweak it.
- 48:04
Don't just accept the first suggestion, as with all AIs, they can get things wrong, so make su- make sure you keep iterating.
- 48:14
Then function-wise, um, now when I accept this,
- 48:18
maybe I make a mistake. Um, classic mistake, just typing parse
- 48:29
system. So you can go every time if you have a linting error, and those can come from extensions. Those are not just built-in VS Code things. If you have X, for example, you also can get accessibility squiggles.
- 48:43
You can go into f- quick fix, and now you can see... Actually, for this one not because it's a, it's a, t-
- 48:51
uh, code spell one. I think there's so much, too much linting stuff in this project. I only get code spell errors. Okay, let's do it the other way. If you have code you wanna fix, you can do the thing I just showed you in the hover, or you can just do right click.
- 49:12
How do you right click here? Let's see. Okay.
- 49:18
You can go into here and then modify using Copilot. That's where you also open inline chat and just hit, hit fix.
- 49:25
And if I actually do insert the mistake, which I think I have, with parses, it will find it. Fix will automatically look at error messages. It will look at potential issues with the code, and it's to generally prompt it to fix any other issues it finds.
- 49:41
So in this case, even though it wasn't a, a general actual issue, it found that parses is misspelled, and it gives me the change. If you wanna see a better view in inline chat to see the change, you can also toggle changes down here and see the actual line versus line comparison.
- 49:59
This is just optimized right now for space. That's what makes inline chat very, uh, compact and easy to use in, in all kind of window setups. So accept this, and that's the quickest way to get rid of squiggle lines with AI.
- 50:18
I think this concludes lab two. Should I just move on? [laughs]
- 50:36
Okay. Going with lab three is explain. Again, same, same thing, just open inline chat
- 50:47
and do slash explain. So it's one of the many commands we provide. Oftentimes with AI, you end up in a very prompt heavy flow where you keep describing the same thing.
- 50:59
Please explain this code to me, or please explain what this code does. So these shortcuts allow you to not be overly prescriptive for very common tasks like fixing bugs and explaining code.
- 51:11
So slash explain, in this case, will not just look at the current code, but will also look at the dependencies you're using, the symbol definitions, the type definitions, the documentation, and all, and it's all over two VS Code and Copilot chat to make the best sense of it.
- 51:27
In this case, now we're using this tiny view to just give you an overview of the code and how it works, like how do I get a URL out of a link element in this case.
- 51:39
But you can also now open this up in the chat panel on the left to give it some more breathing room and make it easier to read.
- 51:46
What's important, all these answers are also linked nicely, so we do a lot of effort in making these, this code in any explanations really shine and easy to interact with.
- 51:57
So you can easily navigate and click around in these answers as well. That's a recent improvement that landed. If you, if you actually generate code in the side panel, it will also have linked elements and have IntelliSense, and you get all the benefits of getting really, really readable code.
- 52:18
There's explanations. If you wanna have a custom explanation, though, you can still do that. So if you wanna have a command I slash explain
- 52:30
classic prompting like I am [REDACTED:age]. It's not really doing the [REDACTED:age] thing.
- 52:46
I'm a very smart [REDACTED:age]-year-old, so [laughs]
- 52:49
You can also ask another language, right?
- 52:51
You can ask it like, yes. Uh, if you wanna-- Yes, I could. If you wanna actually switch that, if you look for Copilot settings, uh, switch it to different languages.
- 53:04
You can actually switch the language of Copilot. So the locale, if you go into your settings in VS Code, there's a locale override locale, and you can switch it to different locale.
- 53:16
So by default, Copilot will be using a language that you pick it in. You can mix up languages. I, my original language is German. I also speak Spanish and French, so when I don't know a word with-- when I speak to my wife, we just switch languages.
- 53:32
Copilot will be as well [laughs] understanding you if you just high level describe it. So in some cases, it's good, like, um, later on, we show you add workspace. It's good to be hitting the right words of concepts that you expect in your code base.
- 53:48
So if you know the word, make, make sure. If you know reference, be, be specific. But otherwise, it's interesting also to be vague and add some ambiguity to let Copilot figure out and give you some ideas on how you can solve a problem.
- 54:04
Okay. So this should get you through the inline chat parts and
- 54:11
into the chat panel, which we already went to. Okay. Chat panel trick number one, um, remember this button up here to open a new chat.
- 54:23
Um, same shortcut is for clearing a terminal. It's c-control L. Very important. Uh, very fun, quick way to start a new conversation. If, yeah.
- 54:39
Because Copilot will look at your history every time you answer, just like in ChatGPT or in beginnings of Bing search AI, where it fell in love with reporters after [REDACTED:age] back and forth conversation, was stuck in a very romantic mode.
- 54:54
Copilot can also s- can stuck, uh, can get stuck on concepts and anything you talk, discussed before. So if you start a new conversation,
- 55:03
reflect that, uh, by actually opening a new chat. You can still switch back and forth in the history, but make sure you begin new conversations actually in a new conversation.
- 55:16
Uh, but also about history and conversations in the inline or the one in between panel, the one with the AI.
- 55:25
Inline chat does not have history right now. It, it has-- If-- Remember that you can, um... Just close this.
- 55:34
You can go up and down to come, to get to old history items, so use that.
- 55:41
But I thought we, we do store these in history now, so I have to, I have to get back to you on that. [laughs] I know, I know they end up somewhere.
- 55:48
But it's all locally kept, so none of these things are synchronized to GitHub. It's all just kept in a place where VS Code keeps its data. It's in your local profile, uh, not anywhere online.
- 56:00
So, uh, quick trick here. If you wanna see everything that, that Copilot can do, it's /help, and that's providing you anytime you forget which commands and what they do and why there are so many, um, that that's the best way.
- 56:15
So that's, that's giving you all, like, learning commands to, for common things like /fix, /explain. Play around with the more edge case-y ones like /new, which allows you to bootstrap a whole new project.
- 56:27
Uh, but it's also the context variables. Uh, but all of these are auto, also autocompleted. If you, as soon as you hit slash or hash, you will see those as well as you play around.
- 56:37
There we go.
- 56:37
Yeah, I was gonna say, I'm not sure where the microphone is.
- 56:46
Okay. Yeah.
- 56:46
Cool.
- 56:46
You had-- Oh, he stepped out. There was a question about how to use the new notebook command there. And so in the discussions on the DevOps thirty version of the repo, I added a little discussion that says, "How do you use that command?"
- 57:03
And it points to, you have to feed it some more context. I'm not a Jupyter Notebooks guy, but it's, uh, it's like, you know, using this data set, I wanna generate this kind of a thing or whatever.
- 57:13
So yeah, some of those commands you'll have to get a little bit familiar with exactly how to follow up that command. What do you need to feed it-
- 57:22
Yeah
- 57:22
... and things like that. So they can be very powerful once you know how to use them.
- 57:26
Yeah.
- 57:26
Who's, who's using notebooks in VS Code? Awesome.
- 57:31
Yeah, it's definitely, if you do data science, uh, not using notebooks, like, it's a great place to move from data analysis to actually writing code and shipping,
- 57:42
shipping it. So, and I use it tomorrow in my demo as well.
- 57:47
Unintended [laughs] product placement here. Okay, uh, generate tests. Think nothing more to add here, just play around with it. It's a great way. Again, it shows off ghost text and /tests.
- 58:01
If you use inline chat, for example, another case where inline chat does a bit more work, it actually tries to detect which testing framework you're using, which folder they should go in.
- 58:12
Um, but it also, if you use ghost text and you have the file open implementation that you're trying to test, and you just start writing tests, it also gives you this magical experience of just understanding the implementation and writing tests for it.
- 58:26
So depending on which flow you like most, um, those are interesting places to explore it. So hack away and ask questions.
- 58:33
Oh, yeah, hit the button. No, I was just gonna say at this point, uh, you can just kinda go through the labs and, and play around. And if you, if you have any questions, raise your hand.
- 58:40
Also, use the discussions. Let me go back to that slide. Um, thank you so much to Harald. Um,
- 58:47
go back to the slide where, uh, all the links are. Um, we'll be happy to help you out. Please continue working on your labs if you wanna do that.
- 58:57
But, um, I just wanted to throw this out there. If anybody has any kind of general Copilot questions, uh, that you wanna ask us, especially Harald, frankly, because he's, [laughs] he actually works on, on, uh, the, the, the VS Code team and, and works on a lot of this stuff.
- 59:11
Um, this is a great opportunity. So if anybody has any questions, um, out there, we'd love to
- 59:18
see if we can answer them.
- 59:21
Questions have to be three point [REDACTED:age]. Everything right now is three point [REDACTED:age].
- 59:27
You can ask it.
- 59:28
Ask it.
- 59:29
Yeah.
- 59:30
Okay. So, so the question was, what, what model are we using?
- 59:32
Oh, that was my favorite question.
- 59:33
Yes.
- 59:33
It's my favorite question. I just closed the issue on GPT four Turbo. Um, it's no public announcement, but I closed the issue on GPT four Turbo. It's rolled out.
- 59:44
So you can ask, actually, in the chat panel, you can ask it which model it's using. And if you're on the latest version,
- 59:52
if not, I'll find you, um, [laughs] it will say GPT four Turbo because I prompted it so.
- 59:58
Four Turbo.
- 59:59
See? If you tell it GPT four Turbo, it's using four Turbo. If you tell it to use GPT [REDACTED:age], it will also tell you that it's using GPT [REDACTED:age], so.
- 1:00:07
But it's actually-- [laughs] So we rolled out, uh, f-four O's and, and it works as well.
- 1:00:13
Uh, inline chat is still 3.5 because 4 is too slow so far.
- 1:00:23
So, so that, so that, so that's interesting. Maybe talk more about that. So-
- 1:00:25
Yes
- 1:00:26
... so 4, uh, even though, even, even Turbo, even though you just closed the issue on Turbo, 4 is still too slow for inline chat.
- 1:00:33
Yeah. We- we're-- So we're constantly running this multi-model flow, um, especially because we, we wanna al- always balance the, the, uh, performance developer experience where it can stay in the flow.
- 1:00:43
And that's why for completions, we're using 3.5, a very smar- very small context window to stay under these 250 milliseconds instant ghost, uh, text popping up for most users, so on average.
- 1:00:56
And then for inline chat, 3.5, uh, when we ran experiments, when we ran, uh, offline evals and the whole systems we have in place to constantly assess new models, we actually noticed that there's only a slight lift in quality and only in some languages for inline chat going to GPT-4.
- 1:01:14
But then when we ran an ap- experiment, a lot of people churned out because their time to first token is still a lot slower. So we're always taking this approach of balancing this performance and quality aspect and what, what, what provides the best experience in, in the right job.
- 1:01:31
So and that's why, yeah, so every panel channel, panel chat question you ask right now gets-- did get GPT-4, now gets GPT or Turbo. And inline chat, just for that performance aspect, still uses 3.5.
- 1:01:44
Very cool. All right. Now, now when is, uh, GPT-4.0 coming?
- 1:01:48
It's coming. [laughs] [laughs]
- 1:01:50
I had to ask.
- 1:01:51
Yeah. [laughs] Follow the issue. I'll close it.
- 1:01:56
With, um, with all of the work that's being done by Microsoft with, and many others besides, with small models like Phi-3, et cetera, are you looking at testing those and implementing them?
- 1:02:07
Yes, we're testing those. Yeah.
- 1:02:09
Interesting.
- 1:02:09
Uh, there's actually, if you look at the Phi-3 cookbook on GitHub, there's a chat extension sample for VS Code to use Phi-3 locally in chat.
- 1:02:23
Awesome. Out, out of interest, are you able to share what sorts of things you look at when you test new models within the GitHub Copilot product? Like what metrics you might look at?
- 1:02:32
Ooh. The, the, the behind the curtain. So we have-- So most of our offline evals are code-based. So a few things, slash fix, uh, slash docs. And we have a smaller test set that runs generally on each change, code change, where we test specific patterns if they improve or, uh, regress.
- 1:02:54
And that's mostly based on issues we've seen in the past. Like, oh, it didn't get, uh, this pattern right, or it didn't look at specific files. So we're trying to adjust, assess the general competence and what we expected.
- 1:03:06
And then there's larger offline evals where we run it on across different repos and try to understand how, how well these slash fix and slash docs work. So those, these are not public benchmarks, but they're trying to assess basically it against open source code that we can get to run on GitHub.
- 1:03:22
So if you have a repo on GitHub, make sure it run, the test runs. [laughs] Yeah. So yeah, that, that, that's basically gives the baseline. They, they never pass 100%.
- 1:03:31
There's always, like we're trying to get the pass rate up, but it's typical offline eval of we're trying to get better over time. And initially, a lot of the big model updates, they don't necessarily 10X those metrics.
- 1:03:44
There, there's always some languages get better, some languages get worse. So it's, it's really-- And they always require prompt changes. So don't, don't run after the latest model just because somebody told you so.
- 1:03:55
There's always the nuance of actually optimizing for the models and then testing out each model separately.
- 1:04:04
Uh, I didn't quite catch that. Didn't quite catch that. Did you mean that we can test the Phi model locally? Uh, did I understood that right?
- 1:04:13
Uh, check, search GitHub for the Phi-3 cookbook, and there's an example there too.
- 1:04:19
I'm gonna put it in the, in the description.
- 1:04:20
Yeah. Okay. Thank you.
- 1:04:22
All right.
- 1:04:22
So for background, uh, VS Code has an, has extension APIs. Many, many thereof. So all the cool extensions you're running are in VS Code are using these extension APIs to provide the functionality.
- 1:04:34
We have extension APIs for Copilot Chat. You can actually add your own participant, and you can actually provide your own models in the chat as well. So these, these are two, uh, extensions.
- 1:04:47
There's also a blog post, um, that just came out yesterday.
- 1:04:51
Yeah.
- 1:04:51
Uh, I think that will, that, that you can check out on the VS Code blog that talks more about extensions. So if you wanna play around, uh, a lot of pe- companies do this internally for their own developers, just bring in their own developer experience and knowledge into Copilot Chat and some custom flows.
- 1:05:07
And other companies like Stripe and Postgres and o- other projects are bringing these chat participants via extensions into Copilot Chat for some custom workflows for all their developers that they're serving.
- 1:05:20
But that kinda allows you to plug into the existing, I don't know, experience. The-
- 1:05:26
Both. Both. Yeah. Yeah
- 1:05:26
... is it possible-
- 1:05:27
Yeah
- 1:05:27
... or will it be possible to replace the connection to whatever GPT model would be used at the time to be able to use the Copilot at the companies which currently do not allow it?
- 1:05:40
Uh, because that would mean sharing your code as you go with an external provider.
- 1:05:45
Currently not. So that's, that's not a, not a-
- 1:05:47
Yeah, I, I know it currently not-
- 1:05:48
... replacement of the underlying model
- 1:05:49
... but is it-
- 1:05:50
But, but the P- Phi-3 cookbook shows you how to do it in a more sandboxed way to replace parts of the Copilot module.
- 1:05:57
Yeah. I, I understand.
- 1:05:58
Yeah.
- 1:05:58
But, uh, d- is there any chance that it's coming anytime in the future or something like that? Like a-
- 1:06:03
It's on the list of things we're looking into, yeah.
- 1:06:05
Ah.
- 1:06:05
So we're, we're, we're looking at models.
- 1:06:06
All right. Thank you. I mean, I actually have a few more, but I-
- 1:06:11
Yeah. [laughs]
- 1:06:14
Anybody has any questions?
- 1:06:18
Uh, so the next one is, is there any intended use difference between the Control-I inline mode and the, uh, sorry, the Command-I and Command-Shift-I modes?
- 1:06:34
Between inline chat and-
- 1:06:36
Yes, and the inline chat-
- 1:06:39
Yeah. There's no such thing
- 1:06:39
... just like the standard Command-I.
- 1:06:41
Yeah.
- 1:06:42
Right? And then we also have Command-Shift-I, right?
- 1:06:45
Oh, quick chat.
- 1:06:46
Yes.
- 1:06:46
Yeah. Uh, if you haven't tried it yet, Con- Control-A is, uh, quick chat. That's-- The idea is, so we're exploring different just form factors for chat, and that's more of a quick question overlay.
- 1:06:59
So that's kind of the idea. You don't want to go into panel chat, especially on a small viewport.
- 1:07:03
Yeah. All right, all right.
- 1:07:03
So it's mostly a UX pr- preference.
- 1:07:06
But this will have the conversation, uh, the history conversation then.
- 1:07:09
Yeah.
- 1:07:09
All right.
- 1:07:10
Yeah.
- 1:07:10
And does it also have a new chat then that you-
- 1:07:14
You would just close it. You would just... Yeah.
- 1:07:16
Oh, all right.
- 1:07:16
Yeah.
- 1:07:16
So it holds the conversation as long as it-
- 1:07:18
Right
- 1:07:18
... stays active and open.
- 1:07:19
And Control-L works, works, works as well.
- 1:07:21
All right.
- 1:07:21
You can just empty it.
- 1:07:22
Got it. Perfect.
- 1:07:23
Yeah.
- 1:07:23
Uh-
- 1:07:24
And let me, let me, let me just, uh, uh, ask that question so everybody can hear. Um, the, the, the, the question was basically, um, is there a way to take advantage of, uh, I guess, like, local documentation, um, and, and agents that might take, might, might exist in, in, in a code base that might be more
- 1:07:40
updated than, um, what the, what the model itself is. Is that getting close?
- 1:07:45
Yes, but not local documentation, but rather the, the libraries.
- 1:07:48
For-- Right. So, so for libraries. So it's not, not locally, but for other libraries, but for things that, that just the model hasn't been updated for because things are changing all the time.
- 1:07:57
Yeah. So Copilot for Enterprise has knowledge bases. Um, if you do some links in the training in the end to Copilot for Enterprise and some of that documentation. So knowledge bases allow you to import a repository with markdown as, as a grounding, and then reference that in your question, especially on github.com, but also in the [REDACTED:username] agent
- 1:08:20
in VS Code. And we're trying to make that more accessible and naturally to apply to code. But that's one way, um, that you could bring in external documentation, just have it, have it indexed, have it referenced.
- 1:08:34
Then you curate it in these knowledge bases as something you can reference, like using our LLM stack, and then you, you reference the combination of different projects that you're depending on, and you can update them a- a- as you, as needed.
- 1:08:47
Uh, there's more work there, I think, to bring knowledge bases to a more usable and easier-to-update flow. So that's something we're also looking at.
- 1:08:57
And so do you envision then that if people keep doing this, we call them agents, right? So the, the Stripe and the Octopus and stuff like that, that you can add that.
- 1:09:07
Yeah.
- 1:09:08
Uh, if people keep doing them, would you imagine that the Copilot would be able to just automatically understand that, right, if I'm asking about something connected to Octopus, and I maybe don't know the answer, I can just kind of reference that from this agent?
- 1:09:25
Yeah.
- 1:09:25
And so the Copilot would ask the agent, and it gets the answer by-
- 1:09:28
So the question is, do you... Uh, I guess two questions. So one is, do, is there some knowledge retrieval we can do with these chat participants? Uh, chat participants can provide context variables.
- 1:09:38
So if there is specific context that those participants want to provide, like their API documentation or more dynamic things like which actual databases are used in your, in your product and what is their schema, they can be exposed as context variables, so you can combine them with other context.
- 1:09:56
And we actually, yeah, we're just looking into more automatic inference, how to get this context in, so you don't have to know about-
- 1:10:05
Rather not providing the context, but rather like, uh, agent delegation, I would say. So like the GitHub Copilot would work as an orchestrator in a way-
- 1:10:15
Yeah
- 1:10:15
... where, um, it can delegate specific questions to specific agents, which then can hold like specific information on that domain or that library or database.
- 1:10:24
Yeah. So-
- 1:10:25
So, so you're basically saying if you asked a question and, and Copilot didn't know it, but it was about something that you had an extension installed with or an agent installed with, it could automatically then send that to, to, to the agent.
- 1:10:35
Yeah.
- 1:10:36
Yeah. That's, that's actually on the exploration for, within the next six months. So we're looking... 'Cause we, we see when people discover extensions, it's like, "Oh, this is amazing.
- 1:10:45
I want to use this every day," and then they keep forgetting about it, or they, uh, they never discovered it upfront, so that's a big problem we saw in our user testing.
- 1:10:53
So the automatic inference is a big part of just Copilot being aware of what you have installed, uh, what you're working on, and then calling the extensions as needed.
- 1:11:03
So that's coming.
- 1:11:05
Awesome. Well, thank you so much, Harald, for this impromptu Q&A that I just, like, threw at you at the last minute. We really appreciate that. No, no, no, no, no, no, no, you were fantastic.
- 1:11:13
I just... This was an idea that, that Dave and I had. We were like, "Well, while we have, you know, member of the-
- 1:11:19
Of course. [laughs]
- 1:11:19
... member of product team."
- 1:11:21
Uh, Harald mentioned the blog post from Visual Studio Code that I didn't even realize was out yesterday. So
- 1:11:30
on the main repo link, there's a github-copilot-resources.md file, and I already had a reference to the Copilot extensions blog post that came out in conjunction with Microsoft Build. So in that section, I said, "And see also this Visual Studio Code."
- 1:11:47
So we're, you know, we're being as dynamic as we can here. Um,
- 1:11:56
there you go. Yeah. So that blog post is now, you don't have to remember this URL, just the, the repo your, or the DaveOps resource-- Or sorry, the DaveOps version of the GitHub Copilot, uh, lab.
- 1:12:13
The, check out the resources file there. Also, check out the discussions. I wasn't able to find what Harald was referring to with the cookbook 5.3 or whatever, but we can throw Oh, awesome.
- 1:12:27
Awesome. So yeah, when you go to those discussions, you know, we, we have those links and, and things there. We'll even-- I'll keep an eye on those, uh, discussions for a few days, so if something else comes up, feel free to, uh, throw a question or a comment out there.
- 1:12:45
And since we are-- we got about a little over twenty minutes left here, I will put in a plug too. There's a couple of survey questions there. Please let us know what you thought about this lab.
- 1:12:56
Please let us know what you thought about GitHub Copilot in general. And, you know, add comments on either one of those if you, uh, would like to.
- 1:13:15
Anybody else have any other questions or anything? [chuckles]
- 1:13:33
Is GitHub Copilot Workspace going to replace Copilot Chat, or
- 1:13:40
does it have any other purpose, uh-
- 1:13:45
Yeah, I think from my perspective, yeah, I'll let Harald talk about it, but I think there's, you know, a purpose for Copilot Workspace and a purpose for Copilot Chat and, and everything.
- 1:13:56
I'll let Harald address it.
- 1:13:58
It's Copilot, the whole of things.
- 1:14:00
Yes.
- 1:14:00
So who has seen Copilot Workspace? Okay. Let me describe it in break stroke, [chuckles] great stroke. So Copilot Workspace is a standalone experience where you can start from a repository or a PR or other places.
- 1:14:19
There's great demos, great videos out there. There's an early adopter audience already playing around and getting really excited about these flows. But you can start with a task. It breaks it down into a plan, and it allows you to make cross-repo, uh, cross-file edits and implement features, fix bugs that are more complicated.
- 1:14:41
But it's a, it's a great end-to-end flow that keeps the developer in control at every step and allows you to give feedback and correct the plan and correct the plan items and stay in the loop as the AI proposes changes.
- 1:14:58
The outcome is that you end up with a diff, and the diff can even run the actions in the repository. You have a terminal where you can run through your build step and have other ways.
- 1:15:08
So there's a lot of, a lot of pieces built in that suddenly look like an editor. So my, my hopes this is eventually something that if you ask a more complicated question in chat, it will just use a workspace-like flow to apply these edits.
- 1:15:22
But there's also other explorations that we're applying. How can this look like in PR reviews? What's the best workspace flow for the many things developers hit in a day-to-day?
- 1:15:34
How can AI help with reviewing a PR? So all of these things are where a more specialized AI breaks down a task into multiple steps and keeping you in the loop and in control.
- 1:15:48
So I don't think it's a replacement. It's a, it's a necessary flow. It's something you can already do in GitHub Copilot Chat. Just start with asking it about a plan and then work with Copilot through a plan.
- 1:16:01
So with proper prompt crafting, you can get pretty close to that experience and stay in control. I think that's, that's the main one there.
- 1:16:30
In VC, in VS Code. Do I use that?
- 1:16:32
Yeah, yeah.
- 1:16:33
Yeah.
- 1:16:33
So make sure everybody can hear.
- 1:16:34
All right, perfect. I'll, I'll-
- 1:16:36
I'll get my stuff.
- 1:16:37
Hello. Super. [chuckles] Thanks. All right, so the question was, um, Copilot Enterprise has a couple of really cool features such as PR summaries or knowledge bases. I'm keen to understand in terms of those features living in VS or, like, in the code editor.
- 1:16:52
So, so, like- Yeah ... I'm doing a PR. I'd like to immediately summarize what the PR is about. Is there some sort of outlook on what that's gonna look like?
- 1:17:01
So you-- there is a way, um... It's a, it's a different experience, but there is a way to summarize, uh, PRs in VS Code right now. So there is a way to do that, that, that is separate from the, the, the GitHub Enterprise feature.
- 1:17:13
But this is actually, I think, and, and you can talk more about this. This is something we're, we're trying to kind of balance, the, the two experiences between, you know, how things work, you know, kind of on github.com and then the, the way that people are using their editor.
- 1:17:25
Um, if you wanna say more about that process.
- 1:17:28
Some, some hot takes. No. [chuckles] Um, so I think in the beginning, you saw definitely more Copilot experience sprouting up under the, like, Copilot X moment that happened at Universe.
- 1:17:40
So just people trying out, like, what, what does AI mean in developer flow? So PR, uh, descriptions went out there, and then this new tier, uh, SKU for, for Copilot for Enterprise.
- 1:17:51
So I think a lot of it's like, w-what is a value add that we can bring to enterprises that work for if you have a thousand repos and team to manage two thousand developers, what are the different use cases that are not as simplistic, um, of, like, a typical day in a developer working on a project?
- 1:18:08
So there, there's a lot of that thinking right now happening, like how to best separate those. I think a lot of times we, we are focusing on bringing everything that's happening on github.com, making sure it can shift left, uh, into the developer experience in the editor as well.
- 1:18:23
So, uh, as you can see, we already have, like, in Co-- VS Code, you already get the little mag-magical AI buttons that can write you a commit message, that can write you a simple PR description.
- 1:18:35
But if you look at PR descriptions on GitHub, they go to way more lengths of looking at more files. So as you go into CE, those features just become more powerful and more grounded and more suited to the, the, the needs of Enterprise.
- 1:18:50
So I think that's, that's the best way to think about those. Um, and yes, there are some features that are in, locked in CE right now because they're still-- they need more Enterprise feedback, and they, they need to scale to Enterprise needs.
- 1:19:02
Um, but otherwise, yeah, there's definitely shift, shift left of these features happening so they become available in the editor as we figure out how to best provide them in the editor.
- 1:19:11
But no, so if you haven't tried it out in the Codespace, you see the PR extension is automatically installed in the Codespace. So you can manage your issues, your PRs, if you can create PRs, so that's also what, what you can do in Codespaces.
- 1:19:25
Thank you. [outro music]