Now, the main star of GitHub Copilot arguably
is, of course, the chat window here.
Now, when you open it, you'll see that you may have some sessions already.
This is that session, that inline chat session I had
before. You can remove sessions from there by
this archive button, and you may, of course, therefore, also see the sidebar
in this state if you didn't have any sessions yet.
Now, we'll get back to managing sessions later.
Here in this chat mode, you can do many different things,
worth exploring. Most importantly, I'd say, you can
choose between different modes down here.
Now, the exact modes available may change over
build your own modes, your own agents, but at the point of time where
I'm recording this, there is an agent mode, an ask mode, an
edit mode, and a plan mode. And I actually wanna start with
ask mode, though we'll later use plenty of agent
that's the most powerful one. But ask mode
essentially gives you a ChatGPT inside of Visual Studio
Code. You can choose which AI model to use, and of course,
all the usage you have in this chat will count towards the overall
usage you have in your GitHub Copilot subscription.
So you should probably not use it as a drop-in replacement for
ChatGPT. You should use it for questions that
to your code or project, obviously.
But then you can choose from a lot of different models here and just chat
away. For example, you can use this chat for planning a
a feature of a project. Now, for example, let's say here, I wanna build a slightly
more exciting Python project that is a CLI tool that
generates some fake user data. We could start in ask mode and ask some
AI model about how to do that, if we don't know
already. And that is definitely something we could
also do outside of the editor in ChatGPT, but here in this
editor, it will, of course, already know some things about our
example, which Python version we're using, because that is
essentially mentioned here in this project file, in my case here, and that can, of
course, lead to a more meaningful answer.
So here, it spits out a short plan on how we could
CLI tool. It's worth noting that it
automatically looked at some files that I did not
explicitly reference or mention.
So it tries to find relevant context, though you can
also reference context explicitly, and we'll get back to prompt and
context engineering a little bit later.
But by default, it tries to do a good job at
finding relevant files in your project.
So it's aware of your project, and that is the advantage of
using this integrated chat, compared to ChatGPT, which of course,
nothing about your project. You would have to tell it everything it
Here, it tries to automatically find the
information. So here, it even gives me some code suggestions
because, and that's important, in ask mode, it can't
write code. It's ask mode. It's about asking and about
chatting. It's not about editing or writing code.
What you could do now to change that is you could switch to
edit or agent mode. The difference in the end is that
agent mode is the more powerful mode that is optimized
for working across many files, adding new files,
and working autonomously, whereas edit mode is
more optimized for small edits in individual
files. Now, if I were to try to switch to edit mode,
the point of time we're recording this, it tells me that this would end
this session and therefore, of course, lose all that information from that reply,
which I don't want. For agent mode, this does not happen, and indeed,
typically, if you wanna change some code, you'll typically just
use agent mode. I wouldn't be surprised if edit mode goes away in the
future. There also is plan mode to which you can also
switch without losing your session and your context, and plan
mode is essentially another ask-like
mode that's optimized for producing a
fine-tuned, optimized plan for whichever feature you
implement. And just to be very clear, you don't have to start with
ask mode in order to start planning or writing code.
This is just one example for using ask code to explore
some ideas. But we'll now take a look at these other
next lectures.