WEBVTT

00:00.160 --> 00:01.800
Well, this might be a bit of an anti-climax.

00:01.840 --> 00:04.440
I'm just saying we have to write our crew function.

00:04.440 --> 00:07.400
We don't have to write our crew function because the default thing, there is all that we need.

00:07.400 --> 00:08.800
We don't need to do anything else.

00:08.800 --> 00:12.840
We've already got something which can do exactly what we want.

00:13.120 --> 00:17.000
What we do need to do still is come into main and rewrite this.

00:17.040 --> 00:19.440
And of course it's got all of the usual stuff.

00:19.440 --> 00:21.080
We don't need any of the stuff that's there.

00:21.120 --> 00:27.320
We'll just delete everything and come back here and write our own run function.

00:27.360 --> 00:28.680
Def run.

00:29.040 --> 00:30.920
This is the thing that's going to run the crew.

00:31.240 --> 00:37.320
And so we are going to say inputs equals assignment.

00:37.360 --> 00:38.640
How do I spell assignment.

00:38.680 --> 00:40.240
Assignment.

00:40.240 --> 00:42.040
There we go colon.

00:42.040 --> 00:44.880
Let's just give that a variable assignment for now.

00:45.240 --> 00:56.920
And then we're going to say results equals coder dot crew dot kickoff passing in those inputs.

00:57.200 --> 01:07.050
And then we want to print result Raw is how the result will come back and then we will indeed have.

01:07.290 --> 01:11.330
We don't need that main in there because it will automatically run that for us.

01:11.730 --> 01:12.210
Okay.

01:12.250 --> 01:15.730
And so what's left to do, of course, is to set the actual assignment.

01:15.850 --> 01:19.250
So let's come up with assignment assignment.

01:19.250 --> 01:25.570
And we're going to do something challenging here because I want to check if I said something like the

01:25.610 --> 01:27.370
default the cursor has got for us there.

01:27.410 --> 01:27.650
Right.

01:27.690 --> 01:30.170
A Python script that prints Hello world.

01:30.370 --> 01:36.690
Then we might not know for sure that it's actually running it, because Llms are perfectly capable of

01:36.690 --> 01:40.690
knowing what a script like that would yield would result in.

01:40.690 --> 01:44.650
So it could generate the Python code and then pretend it ran it.

01:44.650 --> 01:48.050
So we want something that it can't do any pretending for.

01:48.090 --> 01:53.130
And so I have one thing to show you, although knowing Llms, it probably could pretend this as well,

01:53.130 --> 01:54.850
but I certainly think this is a harder one.

01:55.210 --> 02:03.510
So I wanted to write a Python program to calculate the first 10,000 terms of this series, multiplying

02:03.510 --> 02:04.830
the total by four.

02:05.230 --> 02:07.030
So I put it in quite a complicated way.

02:07.350 --> 02:15.910
And here's the series one minus a third plus a fifth, minus a seventh plus dot dot dot.

02:16.550 --> 02:24.270
And so I'm just kind of it's a classic case of just sort of asking the LM to figure it out like a reasonable,

02:24.270 --> 02:26.310
intelligent human would.

02:26.470 --> 02:30.390
And who would have thought a few years ago that you could write software that would be able to take

02:30.390 --> 02:35.510
something like this with all of the nuance, all of the implications, and figure out that it needs

02:35.510 --> 02:42.070
to write code to put this into a loop, to keep it going for 10,000 terms, and then to take the total

02:42.070 --> 02:43.470
and multiply it by four.

02:43.950 --> 02:53.190
And the mathmos around will probably have already spotted this as being a very slow and very, uh,

02:53.190 --> 02:55.790
boring way to calculate pi.

02:56.150 --> 03:01.550
So if it does this right, and if it calculates the first 10,000 terms and multiplies by four, then

03:01.550 --> 03:02.960
it will be an approximation.

03:03.000 --> 03:05.120
A bad approximation of pi.

03:05.480 --> 03:11.440
And now the Llms are perfectly capable of recognizing this formula and knowing that the answer should

03:11.440 --> 03:12.120
be pi.

03:12.160 --> 03:17.680
But what's much harder is for them to realize that 10,000 terms would be approximately pi, and be wrong

03:17.720 --> 03:19.000
after a few decimal places.

03:19.040 --> 03:23.000
And so that's how we can tell that it's really doing its thing.

03:23.280 --> 03:25.440
So I hope that all makes sense.

03:25.440 --> 03:27.160
It's time for us to actually run this.

03:27.600 --> 03:29.400
All right, everyone, this is exciting.

03:29.440 --> 03:30.240
The drum roll.

03:30.240 --> 03:33.680
We're going to try and have our coder do its thing.

03:33.680 --> 03:35.280
So let's bring up a terminal.

03:35.640 --> 03:37.680
Let's go into the third directory.

03:37.680 --> 03:42.360
Let's go into coder and let's type crew I run to kick this off.

03:42.480 --> 03:46.920
And remember the challenge is now being set to our agent.

03:46.960 --> 03:48.320
You can see it started.

03:48.360 --> 03:51.920
There's the command and it's now going to be thinking about it.

03:52.160 --> 03:56.040
And something just ran and failed in the code interpreter.

03:56.040 --> 04:00.480
So it's that one means it's its first try and it's trying again.

04:00.880 --> 04:02.640
So it's not like it always works.

04:02.730 --> 04:07.050
At least it shows us that something is trying to run in an interpreter.

04:07.090 --> 04:07.410
Okay.

04:07.450 --> 04:08.290
It's done some code.

04:08.290 --> 04:09.010
It's got an answer.

04:09.050 --> 04:10.570
It just all happened really fast.

04:10.850 --> 04:15.970
So, um, this is the code that it's got, that it's written, and this is the output.

04:15.970 --> 04:21.690
It's used an interesting technique I can see it's it's obviously, uh, it's, it's going through the

04:21.690 --> 04:23.370
number of terms as it should do.

04:23.770 --> 04:26.250
It's a number of terms it sets down below.

04:26.250 --> 04:27.330
That's nicely done.

04:27.570 --> 04:33.210
And then it's using this idea of take minus one to the power of the index, which is either going to

04:33.210 --> 04:34.690
be minus one or plus one.

04:34.730 --> 04:36.010
It's a clever trick.

04:36.330 --> 04:39.410
And dividing by that which looks right to me.

04:39.450 --> 04:43.490
And then where do we see it multiplying the result by four.

04:44.370 --> 04:45.050
There, right there.

04:45.090 --> 04:47.290
I was going to say that would be suspicious.

04:47.330 --> 04:50.210
It does indeed multiply the result by four.

04:50.330 --> 04:58.250
And that's why we get 3.14149, not 3.14159, because it is just an approximation of pi.

04:58.450 --> 05:00.330
And it seems to have worked.

05:00.330 --> 05:04.230
And indeed, if also we see that it's created an output file.

05:04.270 --> 05:05.190
Yes it has.

05:05.390 --> 05:11.110
And here in the output file we will find the same output which has got the code.

05:11.230 --> 05:13.190
The output below it.

05:13.430 --> 05:18.310
And I gotta tell you, I'm blown away by how easy it is to do this.

05:18.470 --> 05:24.150
And all of the machinery that's happening behind behind the scenes to be able to start a Docker container,

05:24.190 --> 05:29.110
come up with the code, run the code, come up with the answer to the way that I expressed it.

05:29.110 --> 05:30.630
In quite a simplistic way.

05:30.750 --> 05:32.710
It just figured the whole thing out.

05:32.830 --> 05:35.350
And I think that's that's really cool.

05:35.870 --> 05:36.790
And there you have it.

05:36.830 --> 05:39.310
We just gave coding skills to an agent.

05:39.350 --> 05:42.630
We have our coder agent and it was so simple.

05:42.630 --> 05:44.910
And I hope you enjoyed it as much as I did.

05:45.110 --> 05:45.670
All right.

05:45.670 --> 05:47.470
Well, it ain't over yet.

05:47.470 --> 05:53.110
We've got more to go because the natural extension, now that we've got a coder, we can build an entire

05:53.110 --> 05:54.590
engineering team.

05:54.630 --> 05:56.830
It's really the goes to the meaning of crew.

05:56.870 --> 06:01.590
We're going to build a crew, an engineering crew, to be able to solve problems front to back.

06:01.590 --> 06:03.350
And it's going to be so great.

06:03.390 --> 06:04.190
I'll see you then.
