WEBVTT

00:00.040 --> 00:02.200
Did I just say that I'd stop this pantomime?

00:02.360 --> 00:03.400
Well, I take that back.

00:03.400 --> 00:05.360
We'll do the pantomime one more time.

00:05.360 --> 00:09.840
I've just added in another response from the nice LM agent.

00:09.840 --> 00:12.400
So I'm going to have the LM agent, uh, respond to.

00:12.440 --> 00:13.040
Hi there.

00:13.080 --> 00:18.400
I'm going to have the disagreeable agent disagree, and then I'll put it back to, uh, to GPT for a

00:18.400 --> 00:21.400
minute to see how it handles the disagreement.

00:21.760 --> 00:23.680
Let's see how this little conversation goes.

00:23.840 --> 00:24.520
Hi, there.

00:24.840 --> 00:26.040
Uh, hello.

00:26.080 --> 00:27.320
How can I assist you today?

00:27.960 --> 00:29.840
Uh, you said hello.

00:29.840 --> 00:31.960
How can I assist you today, and I disagree.

00:33.240 --> 00:37.600
Then GPT for him, and he says, I appreciate your feedback.

00:37.800 --> 00:40.120
How would you prefer I greet you or assist you?

00:41.480 --> 00:46.080
So if you want to be cruel, you can keep this going and just have it continually disagreeing and see

00:46.080 --> 00:48.760
how, uh, how GPT four and mini handles that.

00:48.800 --> 00:54.840
And once you've had your fun, then you should do this, this, this stops the runtime and then closes

00:54.840 --> 01:00.210
the runtime, which the auto gen core people insist that we do before we start another.

01:00.210 --> 01:03.490
So we will we will do that and be and be good to it.

01:03.530 --> 01:03.890
Okay.

01:03.890 --> 01:08.010
But for one more example, and I'm afraid this time we're not going to have sort of true commercial

01:08.010 --> 01:13.770
examples because, uh, I think this is just one to show the platform at work, and you can take this

01:13.770 --> 01:15.770
away and figure out what you'd like to do with it.

01:15.770 --> 01:20.890
But for this example, uh, we're going to play rock, paper, scissors between a few agents to show,

01:20.930 --> 01:25.530
because I just want to illustrate the fact that this collaboration, this this interaction is what it's

01:25.530 --> 01:26.250
all about.

01:26.450 --> 01:33.450
So very simply, we have a player, one agent that is a subclass of rooted agent.

01:33.690 --> 01:41.730
And it, uh, it has a, um, um, open AI chat completion client as its underscored delegate.

01:41.730 --> 01:50.570
It has an assistant agent that uses that as the model client, and then it has, uh, handle my my message

01:50.570 --> 01:54.500
type that takes messages and and returns the response.

01:54.500 --> 02:02.500
So this is a super vanilla kind of LM routing that will just simply do respond to the message that is

02:02.500 --> 02:04.300
given in the message object.

02:04.500 --> 02:05.020
Okay.

02:05.060 --> 02:09.020
We got a player two which is exactly the same thing, but with one tiny difference.

02:09.020 --> 02:09.900
Can you spot it?

02:10.140 --> 02:11.860
Can you spot the difference between those two?

02:12.860 --> 02:19.540
Well, the difference is that this has a llama track completion client instead of OpenAI track submission

02:19.540 --> 02:19.780
client.

02:19.780 --> 02:21.100
So we're going to use a llama.

02:21.100 --> 02:22.780
We're going to use a local model.

02:23.060 --> 02:27.940
And we are going to see which model that we pick.

02:28.180 --> 02:33.660
For this one we're going to pick llama 3.2, the 3 billion variant of llama 3.2.

02:33.860 --> 02:38.220
So these are are a couple of agents.

02:38.620 --> 02:43.700
And now we're going to have a third one a third agent.

02:43.940 --> 02:47.740
And this is going to be uh rock paper scissors agent.

02:47.740 --> 02:52.150
So this one is going to have a little bit more of a it's going to have an instruction.

02:52.390 --> 02:54.390
You are playing rock paper scissors.

02:55.030 --> 02:55.630
First of all.

02:55.670 --> 02:57.590
So first of all it comes up with this instruction.

02:57.590 --> 02:59.030
You're playing rock paper scissors.

02:59.030 --> 03:01.710
Respond only with the one word one of the following.

03:01.750 --> 03:03.350
Rock, paper or scissors.

03:03.870 --> 03:05.830
And it puts that together into a message.

03:06.470 --> 03:13.630
It looks up the default ID, the default, uh, key for player one.

03:13.630 --> 03:18.750
That type, and it looks up the default for player two, that type.

03:19.030 --> 03:20.550
And it's looking them up.

03:20.550 --> 03:27.350
And it then as part of handling its message, it dispatches off a message to these other agents.

03:27.470 --> 03:30.430
So it's just choosing to to it's not choosing.

03:30.430 --> 03:31.430
It's like coded here.

03:31.430 --> 03:34.030
But but it is sending those messages off.

03:34.470 --> 03:41.110
And with what comes back uh, with the result, it then puts together a little piece of text called

03:41.110 --> 03:43.870
judgment, which says you are playing a game of rock, paper, scissors.

03:43.870 --> 03:44.000
The scissors.

03:44.000 --> 03:45.640
The players have made these choices.

03:45.680 --> 03:45.920
Sorry.

03:45.960 --> 03:46.800
You're judging again.

03:46.840 --> 03:47.720
Rock paper, scissors.

03:47.720 --> 03:49.240
Players have made these choices.

03:49.560 --> 03:49.920
Um.

03:49.920 --> 03:52.040
And then it ends with, uh.

03:52.520 --> 03:53.240
Who wins?

03:53.280 --> 03:54.080
Question mark.

03:54.200 --> 03:57.760
After slipping in the player one's choice and player two's choice.

03:57.920 --> 04:03.120
And then that gets dispatched off to my model, which is GPT four mini.

04:03.440 --> 04:05.880
And we return the response.

04:06.560 --> 04:11.680
So just to summarize, we have a total of three agents that we've defined here.

04:11.800 --> 04:16.840
Three of these like agent managers these agent wrappers, they're not they're not real agents.

04:16.840 --> 04:18.760
They delegate to real agents.

04:19.000 --> 04:23.120
One is called player one and it delegates to OpenAI to GPT four.

04:23.320 --> 04:27.920
Mini one is called player two and it delegates to llama 3.2.

04:28.080 --> 04:29.520
And then they don't have any prompts.

04:29.520 --> 04:31.600
They just do whatever instructions they're told.

04:32.040 --> 04:34.240
And then there's one called judge.

04:34.600 --> 04:41.360
And judge very clearly sends an instruction to each of player one and two saying pick rock or paper

04:41.400 --> 04:42.000
or scissors.

04:42.200 --> 04:47.240
And then with what comes back, it then judges them and returns the outcome.

04:47.520 --> 04:52.360
So there we have a simple setup for a game of rock, paper, scissors.

04:52.480 --> 04:55.200
And you can of course make this something more interesting.

04:55.200 --> 04:59.200
You can have it be be something that's that's entertaining or you can have it be something that's serious.

04:59.200 --> 05:00.080
It's commercial.

05:00.240 --> 05:06.360
Like when we're thinking next time in week six, we're going to be building like a financial trading

05:06.360 --> 05:07.000
setup.

05:07.000 --> 05:12.960
You could imagine this could be something where different agents can interact and can argue about something

05:12.960 --> 05:17.200
like whether or not a particular equity is a good investment or a poor investment.

05:17.200 --> 05:20.280
You could imagine that's the kind of interactions that could be going on.

05:20.280 --> 05:25.120
So this, this, whilst we're using this here for a superficial exercise, there's plenty of ways you

05:25.120 --> 05:31.280
can imagine anytime when you'd want a sort of autonomy and the ability for different agents to be interacting.

05:31.280 --> 05:35.520
You could build that kind of commercial logic into this kind of framework.

05:35.560 --> 05:37.450
And that is what Autogen core is for.

05:37.890 --> 05:39.730
Not for playing rock, paper, scissors.

05:39.730 --> 05:45.410
But anyways, rock paper scissors is the the cards you've been dealt and so you might as well play them.

05:45.450 --> 05:46.570
Let's give it a shot.

05:46.610 --> 05:53.250
And quite simply, we create a threaded agent a single threaded agent runtime, which is the the simple

05:53.290 --> 05:55.250
kind of local runtime.

05:55.410 --> 06:02.010
We register player one, we register player two and give it the ability to instantiate players one and

06:02.010 --> 06:02.370
two.

06:02.890 --> 06:08.970
And then we register the judge, the rock, paper, scissors, and and have everything ready to go.

06:08.970 --> 06:10.610
And we start our runtime.

06:10.650 --> 06:13.490
We've registered everything and this is where we do it.

06:13.530 --> 06:17.450
We are going to find our rock paper, scissors default agent.

06:17.930 --> 06:23.130
We are going to say go and set it going and let's see what happens.

06:23.130 --> 06:23.930
Off it runs.

06:23.970 --> 06:28.530
Agents are talking, stuff is happening and there we go.

06:29.010 --> 06:30.250
Player one said rock.

06:30.290 --> 06:31.650
Player two said scissors.

06:31.780 --> 06:34.060
Player one wins because rock beats scissors.

06:34.300 --> 06:34.780
Done.

06:35.420 --> 06:36.620
And there you have it.

06:36.620 --> 06:42.460
There you have agents being organized and interacting and agents being discovered.

06:42.460 --> 06:48.860
The rock, paper, scissors agent discovered these two agents by name by identifying them through the

06:48.860 --> 06:54.300
the the sending a message, uh, through the, uh, through the runtime.

06:54.540 --> 07:02.460
Um, and, uh, we saw agents interacting in a game of rock, paper, scissors and being judged managed

07:02.460 --> 07:03.740
by Autogen core.

07:03.780 --> 07:06.820
And so again, there are these two types standalone and distributed.

07:06.820 --> 07:08.100
Today we did standalone.

07:08.100 --> 07:09.700
Tomorrow we'll do distributed.

07:09.700 --> 07:12.500
And I just want to stress again that this is to give you a flavor.

07:12.660 --> 07:17.780
It's not necessarily as essential for for the building of agents that we're doing mostly on this course,

07:17.780 --> 07:22.620
but it's good for you to get this insight and to see it and compare it with the other offerings out

07:22.620 --> 07:23.020
there.

07:23.460 --> 07:25.540
So with that, that wraps up day three.

07:25.540 --> 07:27.500
And as I say, tomorrow we get to distributed.

07:27.500 --> 07:28.340
I'll see you then.
