1
00:00:03,450 --> 00:00:03,990
Okay.

2
00:00:03,990 --> 00:00:04,710
So.

3
00:00:06,220 --> 00:00:12,910
In this chapter we are going to talk about a basic long chain operations.

4
00:00:13,090 --> 00:00:23,320
So the goal of this chapter is not to go into details, is just show you how easy it is to work with

5
00:00:23,320 --> 00:00:24,400
a long chain.

6
00:00:24,880 --> 00:00:27,010
So a.

7
00:00:28,650 --> 00:00:33,720
From now on you are going to see the screen in these two sides.

8
00:00:33,810 --> 00:00:42,270
In this side we are going to follow the presentation in order to to have, you know, the main concepts

9
00:00:42,270 --> 00:00:49,350
we are talking about and in this other side is where we are going to have the code of our application.

10
00:00:49,350 --> 00:00:52,290
As you can see, this is a Jupyter notebook.

11
00:00:52,290 --> 00:00:55,350
And in the Jupyter notebook you see a couple of things.

12
00:00:55,350 --> 00:00:58,830
You have markdown and you have code.

13
00:00:58,830 --> 00:01:01,500
So a Jupyter notebook.

14
00:01:02,040 --> 00:01:03,240
Let's move.

15
00:01:03,240 --> 00:01:08,190
This Jupyter notebook is something you.

16
00:01:09,240 --> 00:01:13,920
And you create, you will see that we will have the terminal open.

17
00:01:13,920 --> 00:01:18,420
As you see, you can see that I have a virtual environment here.

18
00:01:18,420 --> 00:01:25,860
And we are also having a ChatGPT here as an assistant for us.

19
00:01:25,860 --> 00:01:31,680
So for example you can come here, you can use GPT 3.5.

20
00:01:31,680 --> 00:01:39,930
This is the free version or GPT four which is the plus uh, subscription of OpenAI.

21
00:01:39,930 --> 00:01:49,290
And this allows you for a very, very, uh, convenient price, uh, to use different, uh, functionality.

22
00:01:49,290 --> 00:01:56,010
The default is extremely good because it knows about coding is really amazing.

23
00:01:56,010 --> 00:01:59,520
It's like GPT 3.5 on steroids.

24
00:01:59,520 --> 00:02:01,980
But you also have, you know, different possibilities.

25
00:02:01,980 --> 00:02:04,230
Like to browse with Bing.

26
00:02:04,230 --> 00:02:11,310
And this is where you can find answers to, uh, current matters, you know, things that happened yesterday

27
00:02:11,310 --> 00:02:11,970
or whatever.

28
00:02:11,970 --> 00:02:12,480
Right.

29
00:02:12,480 --> 00:02:19,410
So for example, if you enter here how to install Pyenv.

30
00:02:21,840 --> 00:02:25,110
You are going to see that immediately.

31
00:02:25,110 --> 00:02:31,440
GPT four is going to, uh, give you the detailed instructions for doing so.

32
00:02:31,440 --> 00:02:38,070
So super easy companion to have a in the terminal.

33
00:02:38,070 --> 00:02:46,380
You know that I have several windows of the terminal open in one of the, uh, one of the windows.

34
00:02:46,380 --> 00:02:51,000
I, I entered Jupyter notebook.

35
00:02:51,690 --> 00:02:57,240
If you click here, you are going to see a screen like this.

36
00:02:58,450 --> 00:03:02,920
So here we have a lot of Jupyter notebooks already created.

37
00:03:02,920 --> 00:03:06,070
You can create a new Jupyter notebook doing this.

38
00:03:06,070 --> 00:03:07,360
Notebook new.

39
00:03:08,400 --> 00:03:09,900
And you will see something like this.

40
00:03:09,900 --> 00:03:12,000
We want this with Python three.

41
00:03:12,030 --> 00:03:17,550
You will see that the Jupyter notebook is a is formed by cells.

42
00:03:17,550 --> 00:03:18,600
This is a cell.

43
00:03:18,600 --> 00:03:22,110
In the cell you can have, you know, code.

44
00:03:27,600 --> 00:03:30,240
In order to execute this code.

45
00:03:30,240 --> 00:03:38,250
Once you are here, you, uh, press shift and enter, and then you execute the code.

46
00:03:38,250 --> 00:03:44,790
And here, if you want to have markdown instead of code, you can have a.

47
00:03:48,620 --> 00:03:49,430
Things like that.

48
00:03:49,460 --> 00:03:49,760
Right.

49
00:03:49,760 --> 00:03:53,510
So this is not going to be executed.

50
00:03:53,540 --> 00:03:56,210
This is just a markdown like like text.

51
00:03:56,210 --> 00:04:03,200
So if you go to ChatGPT and ask about Jupyter Notebook markdown, you will have a complete guide or

52
00:04:03,200 --> 00:04:05,150
super easy to to use.

53
00:04:05,450 --> 00:04:12,500
And this is very, very useful to have markdown with your code because it's going to allow you to understand

54
00:04:12,500 --> 00:04:17,060
the code you're writing, and especially if you are learning or teaching, it's a super useful tool.

55
00:04:17,180 --> 00:04:23,660
And a in the code you can come here and for example comment out this.

56
00:04:23,720 --> 00:04:26,330
Now you do shift enter.

57
00:04:26,330 --> 00:04:29,090
This is not executed because it's commented out.

58
00:04:29,090 --> 00:04:35,120
If you come back and you remove the pound sign and shift enter again, you will execute.

59
00:04:35,870 --> 00:04:37,250
You come here and click in.

60
00:04:37,250 --> 00:04:39,440
Plus you create a new cell.

61
00:04:39,440 --> 00:04:40,340
You click here.

62
00:04:40,340 --> 00:04:41,030
You are removed.

63
00:04:41,030 --> 00:04:42,170
This is super easy.

64
00:04:42,170 --> 00:04:45,440
This is super easy to use Jupyter notebook.

65
00:04:45,440 --> 00:04:55,070
So in this, uh, notebook we have five operations in in long chain to show you how easy it is.

66
00:04:55,490 --> 00:05:02,300
The first thing you see here is how we are invoking the dot env file.

67
00:05:02,300 --> 00:05:09,710
So if you remember in the previous chapter we talk about this hidden file where we have our passwords,

68
00:05:09,710 --> 00:05:11,510
you know and private information.

69
00:05:11,510 --> 00:05:15,860
So this dot m file is something like this.

70
00:05:15,860 --> 00:05:20,900
We have a file that is called dot env.

71
00:05:21,620 --> 00:05:28,730
And we have inside of this file which we can create this file with whatever editor like the typical

72
00:05:28,730 --> 00:05:30,920
notes editor you have in your computer.

73
00:05:30,920 --> 00:05:39,350
Important thing is that this dot m file is in the same directory as the directory you have here.

74
00:05:39,350 --> 00:05:42,800
So here in this folder I have the dot m.

75
00:05:42,800 --> 00:05:47,300
But since it's a hidden file uh, you you cannot see it here.

76
00:05:47,300 --> 00:05:58,070
So in this file I have a variable called OpenAI API key in capital letters equal to, you know, and

77
00:05:58,070 --> 00:06:03,320
here I copy and paste my, you know, OpenAI key.

78
00:06:03,530 --> 00:06:06,290
I close this file, okay.

79
00:06:06,290 --> 00:06:11,870
And uh, and I invoke it from the Jupyter notebook.

80
00:06:11,870 --> 00:06:16,580
So what I'm doing here is import a module called OS.

81
00:06:16,730 --> 00:06:23,960
And from dot m the module dot m import these two uh components.

82
00:06:23,960 --> 00:06:31,970
So this thing the module dot m, uh, if you remember in a previous chapter, the way we import this

83
00:06:31,970 --> 00:06:36,830
module is actually, uh, in importing Python.

84
00:06:37,690 --> 00:06:41,560
A m instead of a m by itself.

85
00:06:41,560 --> 00:06:47,050
So is pip python a dot m okay.

86
00:06:47,560 --> 00:06:53,110
So once you have that imported, if you don't have it, you will see an error message.

87
00:06:53,110 --> 00:06:55,420
Then you go to terminal and you import.

88
00:06:55,420 --> 00:07:02,410
It is like pip install python this dot m.

89
00:07:05,250 --> 00:07:05,940
Okay.

90
00:07:07,080 --> 00:07:08,100
So.

91
00:07:09,180 --> 00:07:13,380
I say pit instead of pip is pip okay?

92
00:07:13,380 --> 00:07:15,600
Then you execute it and you will install.

93
00:07:15,600 --> 00:07:17,820
I have it installed so I'm not going to do it again.

94
00:07:17,850 --> 00:07:30,000
Okay, so once we have that now this Jupyter notebook has my OpenAI API key save in this variable.

95
00:07:30,000 --> 00:07:30,630
Okay.

96
00:07:30,630 --> 00:07:42,360
This is the name that OpenAI require us to have a in order to, uh, use the OpenAI API key.

97
00:07:42,360 --> 00:07:45,420
So first operation we are going to do.

98
00:07:47,020 --> 00:07:51,700
How to connect with an LLM.

99
00:07:51,700 --> 00:07:56,590
In this case, we are going to connect with OpenAI with ChatGPT.

100
00:07:56,620 --> 00:07:57,250
Okay.

101
00:07:57,250 --> 00:08:02,860
We are going to ask a question to ChatGPT from our application.

102
00:08:02,860 --> 00:08:09,190
So the first thing we do is we call the module OpenAI inside of lang chain.

103
00:08:09,190 --> 00:08:13,930
And with this module we are going to create a new instance of an LLM.

104
00:08:13,930 --> 00:08:17,770
In this case we are going to call it my creative LLM.

105
00:08:18,430 --> 00:08:24,520
And as you will see, we are going to include a temperature of 0.9.

106
00:08:24,520 --> 00:08:25,150
Why?

107
00:08:25,150 --> 00:08:31,870
Because uh, we want this instance of LLM to be creative, very creative.

108
00:08:31,870 --> 00:08:40,179
The creativity or the temperature of the OpenAI ChatGPT is from 0 to 1.

109
00:08:40,179 --> 00:08:46,240
So 0.9 is a very high creativity and zero is a very low.

110
00:08:46,240 --> 00:08:53,890
We are going to use low creativity when we want to have very accurate information, and we are going

111
00:08:53,890 --> 00:08:56,890
to use high creativity when we want.

112
00:08:57,190 --> 00:09:05,710
We don't matter about it if if it is a fake content or a hallucination or whatever, we don't care as

113
00:09:05,710 --> 00:09:08,710
long as it is interesting or beautiful for us.

114
00:09:08,710 --> 00:09:09,010
Right?

115
00:09:09,010 --> 00:09:15,220
So we are creating a brand name or we are creating a story for our children or whatever.

116
00:09:15,220 --> 00:09:21,460
We want to have a high temperature, high creativity, or if we want to have factual data, we want

117
00:09:21,460 --> 00:09:24,760
to have low creativity, low temperature.

118
00:09:24,760 --> 00:09:30,940
So this is the question we want to, uh, to send to the.

119
00:09:32,050 --> 00:09:33,520
Chat gpt lm.

120
00:09:33,790 --> 00:09:38,110
So we save this question in a variable.

121
00:09:38,410 --> 00:09:41,770
And then the only thing we do is we.

122
00:09:43,160 --> 00:09:50,480
Send this question to the instance of the LM we have created and print the response.

123
00:09:50,990 --> 00:09:57,830
So this is the response that ChatGPT sent to our application.

124
00:09:59,000 --> 00:10:03,170
As you can see here, all this code is written for you.

125
00:10:03,200 --> 00:10:08,510
I don't want to waste time writing, writing and executing these cells.

126
00:10:08,540 --> 00:10:13,910
This is a pre-written, uh, for you so we can go a little bit faster.

127
00:10:13,910 --> 00:10:21,050
So this is the response that the GPT, OpenAI LM has sent back to us.

128
00:10:21,050 --> 00:10:25,850
So to the question, what are the five best things to do in life?

129
00:10:25,850 --> 00:10:29,840
ChatGPT says, live life of purpose and meaning, blah, blah, blah.

130
00:10:29,990 --> 00:10:30,620
Excellent.

131
00:10:30,620 --> 00:10:31,130
Okay.

132
00:10:31,860 --> 00:10:37,530
So you see how easy it is to connect our application with ChatGPT.

133
00:10:37,530 --> 00:10:40,770
And we can do that with any other foundational.

134
00:10:40,860 --> 00:10:49,020
So we will do the same when we are connecting with llama too, or anthropic or whatever Elm foundation

135
00:10:49,020 --> 00:10:50,310
elm we want to use.

136
00:10:50,460 --> 00:10:57,060
Second thing, I want to show you how to wrap the user prompt with a prompt template.

137
00:10:57,090 --> 00:11:03,060
So we are going to do is we are going to create the prompt template with a variable to include the user's

138
00:11:03,060 --> 00:11:03,750
prompt.

139
00:11:04,590 --> 00:11:07,290
Second, we are going to get the user's prompt.

140
00:11:07,290 --> 00:11:14,490
Then combine the user's prompt with the prompt template, pass the combined prompt to the LM and finally

141
00:11:14,490 --> 00:11:15,240
get the answer.

142
00:11:15,240 --> 00:11:20,850
So what we have done here is we have this question.

143
00:11:20,850 --> 00:11:22,050
Is the prompt okay.

144
00:11:22,050 --> 00:11:25,110
The prompt is what we tell the LM.

145
00:11:25,470 --> 00:11:32,310
So in the second example we are going to do what we are most frequently going to do in our application,

146
00:11:32,310 --> 00:11:35,250
which is in the application.

147
00:11:35,250 --> 00:11:42,780
The LM engineer is going to create a prompt template.

148
00:11:42,780 --> 00:11:52,470
The prompt template is not the full prompt, it's just a part of the prompt that has some parts that

149
00:11:52,470 --> 00:11:55,590
are going to be filled by the user.

150
00:11:55,590 --> 00:12:04,320
So as you can see here, we are using the prompt template module to create my prompt template with this

151
00:12:04,320 --> 00:12:05,190
content.

152
00:12:05,190 --> 00:12:08,430
And in this content we are going to include a variable.

153
00:12:08,430 --> 00:12:14,430
So the template is going to be what are the three best things to do in a destination.

154
00:12:14,430 --> 00:12:18,030
But the destination is not provided here.

155
00:12:18,030 --> 00:12:19,560
It's just a variable.

156
00:12:19,560 --> 00:12:22,770
And this variable will be provided by the user.

157
00:12:22,770 --> 00:12:28,800
So this user can provide this variable from a form or a mobile or an email or whatever.

158
00:12:28,800 --> 00:12:31,320
But in this case we are going to enter it manually.

159
00:12:31,320 --> 00:12:34,950
We say this input variable is Barcelona.

160
00:12:35,460 --> 00:12:43,920
So the prompt we are going to send the LM is going to be what are the three best things to do in Barcelona

161
00:12:43,920 --> 00:12:44,400
okay.

162
00:12:44,400 --> 00:12:45,510
Or Barcelona.

163
00:12:45,900 --> 00:12:49,710
So what we are doing here is we are telling okay.

164
00:12:51,250 --> 00:12:54,010
Enter this prompt template.

165
00:12:54,720 --> 00:12:57,060
With this variable.

166
00:12:57,900 --> 00:13:02,190
And send it to the creative LM.

167
00:13:02,860 --> 00:13:08,080
You have created and print the response.

168
00:13:08,080 --> 00:13:13,330
So the LM ChatGPT in this case is going to send back this response.

169
00:13:13,330 --> 00:13:16,330
So what are the three best things to do in Barcelona.

170
00:13:16,360 --> 00:13:18,520
First, explore the Sagrada Familia.

171
00:13:18,550 --> 00:13:20,530
Second, wondering La Ramblas.

172
00:13:20,560 --> 00:13:22,780
Third, take a day trip to the park.

173
00:13:23,020 --> 00:13:23,590
Blah blah.

174
00:13:24,040 --> 00:13:24,640
Excellent.

175
00:13:24,640 --> 00:13:25,600
Good answer.

176
00:13:26,170 --> 00:13:31,600
Third thing, I want to show you how to combine instructions in chains.

177
00:13:31,780 --> 00:13:38,710
So long chain as its name because of it is very good doing chains.

178
00:13:38,710 --> 00:13:46,630
We will see that chains are just a collection or a sequence of instructions we group together.

179
00:13:47,140 --> 00:13:53,350
So what we are going to do here is we are going to do the first two things we previously did.

180
00:13:53,350 --> 00:13:57,070
So initialize an instance of the foundation lm.

181
00:13:57,070 --> 00:14:01,060
Create the prompt template with a variable to include the user's prompt.

182
00:14:01,090 --> 00:14:02,560
Get the user's prompt.

183
00:14:02,560 --> 00:14:04,720
All this we have already made.

184
00:14:04,720 --> 00:14:12,040
Now we are going to add the fourth step, which is combine the user's prompt with the prompt template.

185
00:14:13,700 --> 00:14:14,510
We will do.

186
00:14:14,510 --> 00:14:20,690
Uh, we will create a chain combining the LM and the Prom template, and we will run the chain.

187
00:14:20,690 --> 00:14:23,390
So this we already did it.

188
00:14:23,390 --> 00:14:28,790
We create we have an instance of the LM, we create a Prom template.

189
00:14:28,970 --> 00:14:35,510
And, uh, in this case, the template is going to be what are the three most remarkable achievements

190
00:14:35,510 --> 00:14:37,340
of a politician?

191
00:14:37,340 --> 00:14:42,170
We don't know which politician is going to be the variable that the user is going to include.

192
00:14:42,530 --> 00:14:49,700
And here what we are saying is create a chain instead of a printing.

193
00:14:49,700 --> 00:14:54,980
Here, all the things we were printing in the previous exercise.

194
00:14:54,980 --> 00:14:57,680
Here we are printing the chain.

195
00:14:57,680 --> 00:15:01,520
We are printing the result of running the chain with this variable.

196
00:15:01,520 --> 00:15:05,660
So the politician that the user is giving us is Winston Churchill.

197
00:15:07,180 --> 00:15:14,530
And here we have created the chain with the component LM chain we have imported.

198
00:15:14,530 --> 00:15:22,840
So here what we are saying is okay, use this component to create a chain that is going to use the LM

199
00:15:22,840 --> 00:15:26,590
you have created and the prompt template you have created.

200
00:15:26,830 --> 00:15:35,320
And here send this chain to the foundation LM to ChatGPT in this case and print the response.

201
00:15:35,320 --> 00:15:42,790
So in this case the prompt we are sending is what are the three most remarkable achievements of Churchill

202
00:15:43,360 --> 00:15:48,160
Downs is going to be first one leading Britain through the World War two.

203
00:15:48,160 --> 00:15:53,140
Second, establishing the special relationship between the United Kingdom and the United States.

204
00:15:53,140 --> 00:15:56,860
And third, winning the Nobel Prize in Literature.

205
00:15:56,890 --> 00:15:59,110
Okay, very good answer.

206
00:16:02,470 --> 00:16:09,100
The next thing I want to review, just to see how easy it is to do things with long chain, is to create

207
00:16:09,100 --> 00:16:10,090
an agent.

208
00:16:10,240 --> 00:16:15,790
So agents are one of the most interesting things with LM applications.

209
00:16:15,790 --> 00:16:19,810
In this case you will see how fast we can create an agent.

210
00:16:19,990 --> 00:16:27,280
But we are going to do is to load external tools, initialize an agent over a foundation LM in this

211
00:16:27,280 --> 00:16:35,530
case OpenAI, and set a goal for the agent and let it decide what tools to use, uh, to achieve it.

212
00:16:35,530 --> 00:16:35,830
Okay.

213
00:16:35,830 --> 00:16:37,330
This is the purpose of the agent.

214
00:16:37,330 --> 00:16:40,450
The agent is going to reason by itself.

215
00:16:40,450 --> 00:16:44,680
So we are going to to in this case, we are going to create an agent.

216
00:16:44,680 --> 00:16:50,650
And we are going to tell him, okay, here you have a tool, uh, to search on Google.

217
00:16:50,650 --> 00:16:53,620
And here you have a math calculator.

218
00:16:54,580 --> 00:16:56,650
Use whatever you need.

219
00:16:56,980 --> 00:16:58,210
You decide.

220
00:16:58,210 --> 00:17:05,109
So if we ask a mathematical question like, okay, you know, calculate the square root of whatever

221
00:17:05,380 --> 00:17:10,150
this agent is going to say, okay, I'm going to use the math calculator for this.

222
00:17:10,420 --> 00:17:17,680
And if we make a question which is I don't know how old are the pyramids in Egypt, the agent is going

223
00:17:17,680 --> 00:17:22,990
to say, okay, for this question, I'm going to use the Google search in order to find the results.

224
00:17:22,990 --> 00:17:23,619
Okay.

225
00:17:23,619 --> 00:17:24,579
So.

226
00:17:25,510 --> 00:17:31,330
We achieve this functionality with these six lines.

227
00:17:31,900 --> 00:17:40,390
So what we are doing here and this, all these six lines are commented out in order to comment it out.

228
00:17:40,390 --> 00:17:47,260
All the code in a in a cell in Mac you use command plus design.

229
00:17:47,290 --> 00:17:53,320
Okay, so if you use this, all the code you have in in the cell is commented out.

230
00:17:53,470 --> 00:17:55,510
What we are saying in this code why?

231
00:17:55,510 --> 00:17:57,670
Why have we commented out this code?

232
00:17:57,670 --> 00:18:06,310
Because as I say here, operations with agents are more expensive in tokens.

233
00:18:06,400 --> 00:18:19,390
So if you know the previous operations have a cost of $0.0003 for you, this one can cost you ten times,

234
00:18:19,390 --> 00:18:20,320
uh, more.

235
00:18:20,320 --> 00:18:23,020
So it's still very low.

236
00:18:23,020 --> 00:18:25,570
But I just wanted to tell you this is more expensive.

237
00:18:25,780 --> 00:18:27,850
How can you control.

238
00:18:27,850 --> 00:18:29,710
How much are you spending?

239
00:18:29,710 --> 00:18:40,210
So in your OpenAI account, you have this usage, uh, tab where you can see how much have you spent

240
00:18:40,210 --> 00:18:40,960
per day.

241
00:18:41,140 --> 00:18:47,140
And you can do a lot of operations and still spend, you know, less than $1 per day.

242
00:18:47,140 --> 00:18:53,890
So it's good for you, you know, to control on a daily basis at the at the beginning, what is your

243
00:18:53,890 --> 00:18:56,680
cost and your expenses in ChatGPT?

244
00:18:56,710 --> 00:18:57,310
Okay.

245
00:18:57,850 --> 00:19:08,050
This is is not exactly real time, but is it can have a delay of one minute in order to to update the

246
00:19:08,050 --> 00:19:10,330
cost that you are, uh, you are having.

247
00:19:10,330 --> 00:19:13,810
So in this case, what we are saying is load the tools.

248
00:19:13,960 --> 00:19:20,800
Initially this is a module two load module to load the tools, a module to initialize the agent, and

249
00:19:20,800 --> 00:19:22,870
a module to initialize the LM.

250
00:19:22,870 --> 00:19:26,140
And these three lines of code make it all.

251
00:19:26,140 --> 00:19:29,380
The first thing we do is load two tools.

252
00:19:29,380 --> 00:19:35,560
Three tools, actually the Google search, the calculator and the LM.

253
00:19:36,370 --> 00:19:42,610
Then we are initializing an agent with the previous tools and the LM.

254
00:19:42,610 --> 00:19:48,610
And the type of agent we are going to use is this type you have here you have several types of agents.

255
00:19:48,610 --> 00:19:49,510
We will see it.

256
00:19:49,510 --> 00:19:57,670
And then with this line of code agent dot run, we are executing the agent with this particular question.

257
00:19:57,670 --> 00:20:01,900
So here as you can see in this prompt we have two questions.

258
00:20:01,900 --> 00:20:07,690
Who is the current leader of Japan and what is the largest prime number blah blah blah.

259
00:20:07,870 --> 00:20:12,760
So for the first question the agent is going to use the Google search.

260
00:20:12,760 --> 00:20:16,450
And for the second question it is going to use the math calculator.

261
00:20:16,450 --> 00:20:19,870
And this decision is made by the agent itself.

262
00:20:20,230 --> 00:20:22,810
That's the powerful thing of agents.

263
00:20:23,740 --> 00:20:31,990
And the last thing I want to cover is the memory how to add memory to the LM.

264
00:20:31,990 --> 00:20:40,630
So in this case we are going to use a chain, a predefined chain called conversation chain to record

265
00:20:40,630 --> 00:20:44,650
the conversation in the memory of the LM instance.

266
00:20:44,800 --> 00:20:53,920
So with just these lines we well we are importing a couple of modules OpenAI and conversation chain.

267
00:20:53,920 --> 00:20:57,880
With the first one we are creating a LM instance.

268
00:20:57,880 --> 00:21:05,650
We call it my no creative LM because the temperature, the creativity level is very low and we are going

269
00:21:05,650 --> 00:21:07,120
to create a chain.

270
00:21:08,160 --> 00:21:10,380
With that LM.

271
00:21:11,430 --> 00:21:17,100
This chain is created with the component conversation chain.

272
00:21:17,100 --> 00:21:24,870
And because of that it is going to have a very interesting functionality already included.

273
00:21:24,870 --> 00:21:31,500
So this is one of the predefined chains that long chain has created for us.

274
00:21:31,590 --> 00:21:34,560
And this is going to save us a lot of work.

275
00:21:34,560 --> 00:21:35,070
Okay.

276
00:21:35,070 --> 00:21:41,700
So with this chain that we call my conversation we can start a conversation with the LM.

277
00:21:41,970 --> 00:21:43,440
So hi there.

278
00:21:43,560 --> 00:21:52,560
The LM is going to answer first showing us the prompt, the default prompt that the conversation chain

279
00:21:52,560 --> 00:21:54,240
has created.

280
00:21:54,240 --> 00:21:58,110
And then it's going to tell us okay, this is what you are saying.

281
00:21:58,110 --> 00:21:58,650
Hi there.

282
00:21:58,650 --> 00:22:00,300
And this is what I respond.

283
00:22:00,300 --> 00:22:01,110
Hi there.

284
00:22:01,110 --> 00:22:02,340
How can I help you?

285
00:22:02,580 --> 00:22:04,980
Next thing we tell we tell the LM.

286
00:22:05,340 --> 00:22:06,330
My name is Julio.

287
00:22:06,360 --> 00:22:09,540
What is your name response my name is Ivan.

288
00:22:09,540 --> 00:22:10,800
It's nice to meet you, Julio.

289
00:22:10,830 --> 00:22:11,400
Third thing.

290
00:22:11,430 --> 00:22:13,500
Do you remember my name?

291
00:22:14,910 --> 00:22:16,770
Yes, I remember your name is Julio.

292
00:22:16,770 --> 00:22:24,750
This is just a very basic example to show you how easy it is to create an LM application with memory.

293
00:22:24,750 --> 00:22:29,760
And the last thing you have here is we are printing my conversations.

294
00:22:29,760 --> 00:22:31,170
We are printing these.

295
00:22:31,860 --> 00:22:33,330
Chain you have created.

296
00:22:33,330 --> 00:22:36,810
We are printing just to see what is inside there.

297
00:22:36,810 --> 00:22:40,110
You see that inside here, this variable, my conversation.

298
00:22:40,110 --> 00:22:41,670
There are a lot of things.

299
00:22:42,120 --> 00:22:43,470
There are memory.

300
00:22:43,470 --> 00:22:51,390
There are things like human message, I message, etc. etc. we will see what is this about in the next

301
00:22:51,390 --> 00:22:51,840
chapter.

302
00:22:51,840 --> 00:23:00,210
So the purpose of this initial chapter regarding long chain is just to show you how easy it is to work

303
00:23:00,210 --> 00:23:03,450
with this framework and how powerful it is.

304
00:23:04,080 --> 00:23:11,310
What we have covered here are super simple things we haven't gone through details you know, into details,

305
00:23:11,310 --> 00:23:18,900
but you see how easy it is, uh, to communicate with, uh, the, the long chain code, to use the

306
00:23:18,900 --> 00:23:23,640
long chain code and to integrate, you know, different tools and different functionality.

307
00:23:23,640 --> 00:23:26,880
We will go into details in the next chapters.

