WEBVTT

1
00:00:00.000 --> 00:00:01.170
<v ->Hey there, Eden here.</v>

2
00:00:01.170 --> 00:00:03.240
Just a quick checking and I made this video

3
00:00:03.240 --> 00:00:05.970
in order to address some feedback I got from students

4
00:00:05.970 --> 00:00:08.430
that tried to integrate different LLMs

5
00:00:08.430 --> 00:00:11.310
and got confused a bit with the stop arguments

6
00:00:11.310 --> 00:00:13.680
for those different LLM providers.

7
00:00:13.680 --> 00:00:16.131
So, I hope this video will clarify this.

8
00:00:16.131 --> 00:00:19.620
So, in order to prevent parsing errors,

9
00:00:19.620 --> 00:00:23.460
we should always check our template isn't indented

10
00:00:23.460 --> 00:00:27.240
and to use the correct stop arguments for our LLM.

11
00:00:27.240 --> 00:00:30.450
So, this can change regarding which models you're using.

12
00:00:30.450 --> 00:00:31.920
When I made this video,

13
00:00:31.920 --> 00:00:35.910
just using \nObservation worked for me.

14
00:00:35.910 --> 00:00:40.500
And you might want to add also Observation without anything

15
00:00:40.500 --> 00:00:44.040
and you might want to try as well Observation:.

16
00:00:44.040 --> 00:00:47.850
And notice for some models like Chat OpenAI,

17
00:00:47.850 --> 00:00:51.090
then according to LangChain's newest version,

18
00:00:51.090 --> 00:00:53.340
you can bind this top argument

19
00:00:53.340 --> 00:00:57.480
with the bind method like you see over here.

20
00:00:57.480 --> 00:01:00.780
And because every vendor updates their SDK

21
00:01:00.780 --> 00:01:01.890
in different times,

22
00:01:01.890 --> 00:01:04.920
then if you're using Gemini, for example,

23
00:01:04.920 --> 00:01:08.970
currently, you need to use the model_kwargs argument.

24
00:01:08.970 --> 00:01:10.590
And if you want to be on the safe side,

25
00:01:10.590 --> 00:01:12.930
you can simply put all of those top tokens

26
00:01:12.930 --> 00:01:14.250
to cover all the cases

27
00:01:14.250 --> 00:01:17.523
because it's really sensitive even for those indents here.

28
00:01:18.540 --> 00:01:22.500
So, if you get a parse error about both a final answer

29
00:01:22.500 --> 00:01:25.260
and a parse-able action, it's almost always

30
00:01:25.260 --> 00:01:29.700
because of an indentation in the prompt template itself,

31
00:01:29.700 --> 00:01:33.420
or there's something wrong with the stop tokens here.

32
00:01:33.420 --> 00:01:35.490
So, this is very, very important.

33
00:01:35.490 --> 00:01:37.440
And if you're having issues,

34
00:01:37.440 --> 00:01:41.280
I recommend you checking the featured question

35
00:01:41.280 --> 00:01:43.290
of this video here.

36
00:01:43.290 --> 00:01:44.520
This might help for you.

37
00:01:44.520 --> 00:01:46.560
And also, it's important to note

38
00:01:46.560 --> 00:01:51.270
that after this section, I created an exercise for you

39
00:01:51.270 --> 00:01:52.830
where we'll be migrating

40
00:01:52.830 --> 00:01:56.400
from the react pattern to function calling.

41
00:01:56.400 --> 00:01:58.380
And by doing function calling,

42
00:01:58.380 --> 00:02:01.050
we're going to resolve this issue

43
00:02:01.050 --> 00:02:04.470
because we're going to shift the tool calling to the LLM,

44
00:02:04.470 --> 00:02:07.920
but more on that when you finish this section

45
00:02:07.920 --> 00:02:09.230
and you'll do the exercise.

46
00:02:09.230 --> 00:02:12.450
So, things have become more elegant,

47
00:02:12.450 --> 00:02:15.003
but this is the basis for everything.

