WEBVTT

1
00:00:00.710 --> 00:00:02.530
In this video we are going to look

2
00:00:02.530 --> 00:00:05.130
a little on all the different options we

3
00:00:05.130 --> 00:00:07.910
have when we call RunAsync.

4
00:00:09.130 --> 00:00:12.630
RunAsync and RunAsyncStreaming have exactly the same options

5
00:00:12.630 --> 00:00:15.990
so we will just cover RunAsync and we

6
00:00:15.990 --> 00:00:20.550
will keep RunAsync for structured output to its

7
00:00:20.550 --> 00:00:21.910
own separate video.

8
00:00:22.830 --> 00:00:26.550
So when we do this we have a

9
00:00:26.550 --> 00:00:30.210
lot of options but behind the scenes it's

10
00:00:30.210 --> 00:00:33.290
actually not that much different.

11
00:00:35.190 --> 00:00:38.410
So let's go through them one by one.

12
00:00:39.230 --> 00:00:42.390
So first up we can just give an

13
00:00:42.390 --> 00:00:44.210
18 thread and nothing more.

14
00:00:44.810 --> 00:00:49.170
We can give the thread and options and

15
00:00:49.170 --> 00:00:51.390
throughout this we can give thread and options.

16
00:00:52.210 --> 00:00:55.530
So the thread itself we saw is the

17
00:00:55.530 --> 00:00:59.030
one that keeps the persistence between the different

18
00:00:59.030 --> 00:01:03.250
calls and I know this specific overload is

19
00:01:03.250 --> 00:01:09.270
actually something that the team is considering removing

20
00:01:09.270 --> 00:01:11.430
because it doesn't really make sense to just

21
00:01:11.430 --> 00:01:13.210
give a thread without a new message.

22
00:01:15.610 --> 00:01:18.470
But the thread itself we don't really do

23
00:01:18.470 --> 00:01:20.830
anything other than get it from the agent

24
00:01:20.830 --> 00:01:22.870
and then paste it in.

25
00:01:23.630 --> 00:01:32.630
The options might look a bit empty in

26
00:01:32.630 --> 00:01:34.450
that we can give some additional properties.

27
00:01:34.950 --> 00:01:38.130
In general there's always an additional property that

28
00:01:38.130 --> 00:01:41.670
can be used to put in new things

29
00:01:41.670 --> 00:01:42.530
at some point.

30
00:01:43.170 --> 00:01:46.230
It doesn't really do anything for most of

31
00:01:46.230 --> 00:01:49.650
the providers but they have made it ready

32
00:01:49.650 --> 00:01:50.690
so it's possible.

33
00:01:51.470 --> 00:01:53.950
And then there's something called background responses.

34
00:01:54.250 --> 00:01:57.710
It's a very very niche feature that needs

35
00:01:57.710 --> 00:02:02.030
a continuation token in order to be able

36
00:02:02.030 --> 00:02:05.930
to make everything happen in the background and

37
00:02:05.930 --> 00:02:07.610
with long streaming.

38
00:02:08.530 --> 00:02:10.850
I don't think even I will cover this

39
00:02:10.850 --> 00:02:13.410
in this because it's so advanced but I

40
00:02:13.410 --> 00:02:15.270
actually have a video I will link to

41
00:02:15.270 --> 00:02:17.750
in the system if you really want to

42
00:02:17.750 --> 00:02:18.870
see what this is about.

43
00:02:20.430 --> 00:02:23.250
Beyond that we can actually give when we

44
00:02:23.250 --> 00:02:25.890
have a chat client instead of an agent

45
00:02:25.890 --> 00:02:27.950
run options we can give a chat client

46
00:02:27.950 --> 00:02:30.930
agent run options instead and have a bit

47
00:02:30.930 --> 00:02:33.270
more features in that it can give some

48
00:02:33.270 --> 00:02:38.350
chat options similar to what we did up

49
00:02:38.350 --> 00:02:39.670
in the agent itself.

50
00:02:40.010 --> 00:02:42.350
So we can under fly switch to a

51
00:02:42.350 --> 00:02:45.930
different instruction, switch to a different temperature, switch

52
00:02:45.930 --> 00:02:47.050
to some other tools.

53
00:02:47.730 --> 00:02:49.550
So let's say we have an agent that

54
00:02:49.550 --> 00:02:52.530
has three tools but in this specific call

55
00:02:52.530 --> 00:02:53.850
you only want to give two.

56
00:02:54.510 --> 00:02:57.270
That is possible so it can overwrite the

57
00:02:57.270 --> 00:02:57.990
stuff here.

58
00:03:00.570 --> 00:03:02.910
And beyond that it also has the client

59
00:03:02.910 --> 00:03:06.070
factory which is the slow level thing of

60
00:03:06.070 --> 00:03:09.410
being able to manipulate the underlying agents.

61
00:03:11.210 --> 00:03:16.770
So those was the the thread and the

62
00:03:16.770 --> 00:03:17.150
options.

63
00:03:17.350 --> 00:03:19.930
There's a cancellation token, gives itself.

64
00:03:20.730 --> 00:03:24.830
There's serialisation options whenever there's some serialisation back

65
00:03:24.830 --> 00:03:25.410
and forward.

66
00:03:25.690 --> 00:03:28.930
That's mostly again to do with structured output

67
00:03:28.930 --> 00:03:31.230
which we will talk about later.

68
00:03:33.350 --> 00:03:36.310
Then we have the various versions of giving

69
00:03:36.310 --> 00:03:37.110
it as a message.

70
00:03:37.370 --> 00:03:38.530
So we can either give it as a

71
00:03:38.530 --> 00:03:41.290
chat message, a list of chat messages.

72
00:03:43.170 --> 00:03:46.670
Get this for me.

73
00:03:54.990 --> 00:03:59.390
So either messages, chat messages, collection of chat

74
00:03:59.390 --> 00:04:05.410
messages or down here we have all the

75
00:04:05.410 --> 00:04:06.830
things happening together.

76
00:04:07.670 --> 00:04:09.650
So it looks much.

77
00:04:10.170 --> 00:04:13.630
In reality you mostly will just give a

78
00:04:13.630 --> 00:04:17.110
message and an agent thread and that's it.

79
00:04:17.589 --> 00:04:19.910
It is very, very rare that you need

80
00:04:19.910 --> 00:04:22.290
to do more than that but the options

81
00:04:22.290 --> 00:04:22.770
are there.
