WEBVTT

00:00:00.080 --> 00:00:03.860
Now,
the main star of GitHub Copilot arguably

00:00:03.980 --> 00:00:07.070
is, of course, the chat window here.

00:00:07.120 --> 00:00:10.960
Now, when you open it, you'll see
that you may have some sessions already.

00:00:10.980 --> 00:00:13.900
This is that session,
that inline chat session I had

00:00:13.940 --> 00:00:17.720
before.
You can remove sessions from there by

00:00:17.760 --> 00:00:21.640
this archive button, and you may,
of course, therefore, also see the sidebar

00:00:21.700 --> 00:00:24.120
in this state if you didn't have any
sessions yet.

00:00:24.160 --> 00:00:26.800
Now,
we'll get back to managing sessions later.

00:00:26.900 --> 00:00:30.700
Here in this chat mode,
you can do many different things,

00:00:30.710 --> 00:00:34.470
worth exploring. Most importantly,
I'd say, you can

00:00:34.560 --> 00:00:36.700
choose between different modes down here.

00:00:36.740 --> 00:00:40.660
Now,
the exact modes available may change over

00:00:40.740 --> 00:00:44.700
build your own modes, your own agents,
but at the point of time where

00:00:44.720 --> 00:00:48.640
I'm recording this, there
is an agent mode, an ask mode, an

00:00:48.760 --> 00:00:52.740
edit mode, and a plan mode.
And I actually wanna start with

00:00:52.750 --> 00:00:56.670
ask mode,
though we'll later use plenty of agent

00:00:56.680 --> 00:01:00.160
that's the most powerful one. But ask mode

00:01:00.230 --> 00:01:04.080
essentially gives you a ChatGPT inside of
Visual Studio

00:01:04.120 --> 00:01:08.050
Code. You can choose
which AI model to use, and of course,

00:01:08.140 --> 00:01:11.960
all the usage you have in this chat will
count towards the overall

00:01:12.080 --> 00:01:15.000
usage you have in your GitHub Copilot
subscription.

00:01:15.040 --> 00:01:18.500
So you should probably not use it as a
drop-in replacement for

00:01:18.600 --> 00:01:22.500
ChatGPT.
You should use it for questions that

00:01:22.540 --> 00:01:24.940
to your code or project, obviously.

00:01:24.980 --> 00:01:28.900
But then you can choose from a lot of
different models here and just chat

00:01:28.960 --> 00:01:32.940
away. For example,
you can use this chat for planning a

00:01:33.000 --> 00:01:36.790
a feature of a project. Now, for example,
let's say here, I wanna build a slightly

00:01:36.880 --> 00:01:40.480
more exciting Python project that
is a CLI tool that

00:01:40.540 --> 00:01:44.420
generates some fake user data.
We could start in ask mode and ask some

00:01:44.460 --> 00:01:47.170
AI model about how to do that,
if we don't know

00:01:47.220 --> 00:01:50.910
already.
And that is definitely something we could

00:01:51.020 --> 00:01:54.900
also do outside of the editor in ChatGPT,
but here in this

00:01:54.980 --> 00:01:58.800
editor, it will, of course,
already know some things about our

00:01:58.840 --> 00:02:02.540
example, which Python version we're using,
because that is

00:02:02.580 --> 00:02:06.300
essentially mentioned here in this project
file, in my case here, and that can, of

00:02:06.340 --> 00:02:08.530
course, lead to a more meaningful answer.

00:02:08.560 --> 00:02:12.400
So here,
it spits out a short plan on how we could

00:02:12.460 --> 00:02:15.580
CLI tool. It's worth noting that it

00:02:15.680 --> 00:02:19.360
automatically looked at some files
that I did not

00:02:19.400 --> 00:02:21.840
explicitly reference or mention.

00:02:21.900 --> 00:02:25.730
So it tries to find relevant context,
though you can

00:02:25.780 --> 00:02:29.580
also reference context explicitly,
and we'll get back to prompt and

00:02:29.640 --> 00:02:31.360
context engineering a little bit later.

00:02:31.380 --> 00:02:35.260
But by default,
it tries to do a good job at

00:02:35.320 --> 00:02:38.540
finding relevant files in your project.

00:02:38.580 --> 00:02:42.260
So it's aware of your project, and that
is the advantage of

00:02:42.340 --> 00:02:46.060
using this integrated chat,
compared to ChatGPT, which of course,

00:02:46.100 --> 00:02:49.960
nothing about your project.
You would have to tell it everything it

00:02:50.140 --> 00:02:53.170
Here,
it tries to automatically find the

00:02:53.240 --> 00:02:57.060
information. So here,
it even gives me some code suggestions

00:02:57.180 --> 00:03:00.800
because, and that's important,
in ask mode, it can't

00:03:00.960 --> 00:03:04.680
write code. It's ask mode.
It's about asking and about

00:03:04.900 --> 00:03:08.780
chatting. It's not about editing
or writing code.

00:03:08.860 --> 00:03:12.600
What you could do now to change that
is you could switch to

00:03:12.760 --> 00:03:16.560
edit or agent mode.
The difference in the end is that

00:03:17.260 --> 00:03:21.100
agent mode is the more powerful mode
that is optimized

00:03:21.180 --> 00:03:24.560
for working across many files,
adding new files,

00:03:24.660 --> 00:03:28.640
and working autonomously,
whereas edit mode is

00:03:28.700 --> 00:03:32.320
more optimized for small edits in
individual

00:03:32.440 --> 00:03:36.360
files. Now, if I
were to try to switch to edit mode,

00:03:36.380 --> 00:03:40.260
the point of time we're recording this,
it tells me that this would end

00:03:40.320 --> 00:03:44.260
this session and therefore, of course,
lose all that information from that reply,

00:03:44.300 --> 00:03:48.140
which I don't want. For agent mode,
this does not happen, and indeed,

00:03:48.200 --> 00:03:52.080
typically, if you wanna change some code,
you'll typically just

00:03:52.100 --> 00:03:56.000
use agent mode. I wouldn't be surprised
if edit mode goes away in the

00:03:56.040 --> 00:03:59.580
future. There also is plan mode to
which you can also

00:03:59.680 --> 00:04:03.520
switch without losing your session
and your context, and plan

00:04:03.560 --> 00:04:07.080
mode is essentially another ask-like

00:04:07.380 --> 00:04:11.010
mode that's optimized for producing a

00:04:11.040 --> 00:04:14.680
fine-tuned,
optimized plan for whichever feature you

00:04:14.720 --> 00:04:18.660
implement. And just to be very clear,
you don't have to start with

00:04:18.779 --> 00:04:22.140
ask mode in order to start planning
or writing code.

00:04:22.150 --> 00:04:26.120
This is just one example for using ask
code to explore

00:04:26.180 --> 00:04:30.100
some ideas.
But we'll now take a look at these other

00:04:30.120 --> 00:04:32.140
next lectures.
