1
00:00:04,350 --> 00:00:11,400
So this is going to be the first level two application you are going to learn how to develop.

2
00:00:11,850 --> 00:00:17,910
This is the user interface that you will create with Streamlit.

3
00:00:17,910 --> 00:00:21,360
This is a very simple application.

4
00:00:21,480 --> 00:00:31,830
The purpose of this application is to rewrite the text that the user enters here in a more formal way,

5
00:00:31,830 --> 00:00:34,200
and in fact, you have different choices.

6
00:00:34,200 --> 00:00:41,370
You can you can change the text to a more formal way or more informal way, or in a American English

7
00:00:41,370 --> 00:00:43,080
or British English or whatever.

8
00:00:43,080 --> 00:00:46,290
So very simple application.

9
00:00:46,440 --> 00:00:55,470
The interesting thing for you, uh, while practicing this exercise is to look at the, you know, the

10
00:00:55,470 --> 00:01:03,120
design elements, like, for example, this drop downs, uh, or the columns you see here, one column,

11
00:01:03,120 --> 00:01:10,080
two columns, or, you know, the font sizes you have here, you know, or these forms, you know,

12
00:01:10,080 --> 00:01:14,460
input forms where the user can introduce a text.

13
00:01:14,460 --> 00:01:15,120
Okay.

14
00:01:15,540 --> 00:01:25,110
So remember level two applications are toy demos with toy user interfaces.

15
00:01:25,290 --> 00:01:28,350
They are still not professional applications.

16
00:01:28,350 --> 00:01:33,060
They are still what we call prototypes, proof of concepts.

17
00:01:33,060 --> 00:01:41,850
But as you can see, a level two applications are very different for from the level one applications

18
00:01:41,850 --> 00:01:42,600
we have created.

19
00:01:42,600 --> 00:01:53,280
Because when you go to a potential user or to your manager or a potential, um, customer or whatever,

20
00:01:54,000 --> 00:02:01,200
with this prototype, you are going to have a very different response than if you go with a level one

21
00:02:01,200 --> 00:02:02,520
application, right?

22
00:02:02,520 --> 00:02:04,110
Just with the lines of code.

23
00:02:04,110 --> 00:02:09,000
So here the user can imagine a real application.

24
00:02:09,600 --> 00:02:15,780
As you know, the purpose of this, uh, prototypes is to get feedback from the user.

25
00:02:15,780 --> 00:02:21,300
The user is going to tell you that the potential user is going to tell you, okay, I like this.

26
00:02:21,300 --> 00:02:22,320
I don't like this.

27
00:02:22,320 --> 00:02:24,180
We need this other thing.

28
00:02:24,180 --> 00:02:25,410
This is a mistake.

29
00:02:25,440 --> 00:02:29,910
You need to rethink what you are doing here or there or whatever.

30
00:02:29,910 --> 00:02:30,420
Okay.

31
00:02:30,420 --> 00:02:37,650
So once you have this feedback you will then prepare your professional level application what we call

32
00:02:38,190 --> 00:02:40,740
level three application okay.

33
00:02:41,220 --> 00:02:45,390
So remember we are in a bootcamp.

34
00:02:45,390 --> 00:02:54,540
And at this stage the most important thing you can do is to practice, practice, practice.

35
00:02:55,500 --> 00:03:00,930
We are not going to write line by line the code with you.

36
00:03:00,930 --> 00:03:08,700
We are going to provide you the URL of the A this application in Streamlit.

37
00:03:08,850 --> 00:03:15,690
We are going to provide you the code, uh, in the GitHub repository, so you can download the code

38
00:03:15,690 --> 00:03:18,630
and execute the code in your computer.

39
00:03:19,170 --> 00:03:26,850
But we are going to a let it in your hands.

40
00:03:26,850 --> 00:03:31,440
So it is going to be you the person that has to.

41
00:03:32,410 --> 00:03:33,730
Experiment.

42
00:03:33,730 --> 00:03:34,870
Try.

43
00:03:34,870 --> 00:03:36,610
Make mistakes.

44
00:03:36,850 --> 00:03:44,410
Ask questions to ChatGPT for whenever you have a doubt or a problem, go to extremely tutorial.

45
00:03:44,410 --> 00:03:48,100
Go to the W3 schools.com page.

46
00:03:48,100 --> 00:03:50,200
Go to the lunch and documentation.

47
00:03:50,200 --> 00:03:57,400
Go to the previous blog where you have been building level one applications and review your code there

48
00:03:57,400 --> 00:03:59,260
and try the code here, etc..

49
00:03:59,260 --> 00:03:59,590
Right?

50
00:03:59,590 --> 00:04:02,680
So remember this is a bootcamp.

51
00:04:02,830 --> 00:04:12,040
You have a lot of responsibility and this is in fact very good for you because we are showing you how

52
00:04:12,040 --> 00:04:17,920
a real artificial intelligence engineer works on a daily basis.

53
00:04:17,920 --> 00:04:27,250
So if you are new to this, maybe this is going to feel a little bit uncomfortable for you at the beginning,

54
00:04:27,490 --> 00:04:37,150
but you will see it is going to prepare you for the real world, for the real profession of, uh, artificial

55
00:04:37,150 --> 00:04:38,950
intelligence engineers.

56
00:04:39,190 --> 00:04:47,650
If you are a business executive, if you are a following, this, uh, bootcamp, just in order to hire

57
00:04:47,650 --> 00:04:57,940
a team of engineers or hire a consulting firm to develop your applications or whatever, this this a

58
00:04:57,940 --> 00:05:01,870
blog can be a different approach for you.

59
00:05:01,870 --> 00:05:10,270
So maybe for you, it would be okay just to follow these lessons in a faster way without so many practice.

60
00:05:10,270 --> 00:05:14,920
You know, just to understand how an artificial intelligence engineer works.

61
00:05:14,920 --> 00:05:23,710
But even if you are a business executive, I would recommend you to practice with these exercises because

62
00:05:23,710 --> 00:05:24,850
I think they are going.

63
00:05:24,850 --> 00:05:31,900
The practice is going to make you understand better how an artificial intelligence engineers really

64
00:05:31,900 --> 00:05:38,920
work, and for the rest of us, for the, for all the the practitioners, for all the people that wants

65
00:05:38,920 --> 00:05:44,860
to become artificial intelligence engineers, I encourage you practice, practice, practice.

66
00:05:44,860 --> 00:05:53,560
We are going to give you all the tools and all the guidance, but at the end it is you practicing until

67
00:05:53,560 --> 00:05:59,260
you feel comfortable with each exercise.

68
00:05:59,260 --> 00:06:05,620
So for some people this is going to mean 15 minutes, for some others it's going to see it's going to

69
00:06:05,620 --> 00:06:09,910
be three hours, for others would be 6 hours or 10 hours.

70
00:06:09,910 --> 00:06:11,470
Don't worry about it.

71
00:06:11,950 --> 00:06:13,540
Don't feel stress.

72
00:06:13,540 --> 00:06:22,180
If you need more time initially, just repeat and experiment and use your personal assistant ChatGPT

73
00:06:22,180 --> 00:06:23,680
for to.

74
00:06:24,420 --> 00:06:27,480
Progress, to learn, to understand.

75
00:06:27,480 --> 00:06:28,740
Make more questions.

76
00:06:28,740 --> 00:06:32,040
Repeat again, again until you feel comfortable.

77
00:06:32,040 --> 00:06:41,220
Remember, the important thing is that you complete this bootcamp at your own rhythm, at that rhythm

78
00:06:41,220 --> 00:06:45,000
that feels comfortable for you and that works for you.

79
00:06:45,000 --> 00:06:46,590
Okay, so.

80
00:06:49,430 --> 00:06:53,180
We are going to demo this application.

81
00:06:53,210 --> 00:06:57,140
The first thing we are going to do is we are going to enter.

82
00:06:58,160 --> 00:07:03,080
Our OpenAI API key as if we were a user.

83
00:07:03,080 --> 00:07:09,020
Okay, so if we click on the I icon there, you will visualize our key.

84
00:07:09,020 --> 00:07:10,400
That is not a good idea.

85
00:07:10,400 --> 00:07:14,600
So instead we are going to press enter to apply.

86
00:07:14,600 --> 00:07:20,450
And once we have done this we can enter the text we want to rewrite here.

87
00:07:20,450 --> 00:07:29,450
So let's say for example that this user is a new sales person in our company and is the first day in

88
00:07:29,450 --> 00:07:36,020
their career, you know, and they are really scared about writing an email to a customer.

89
00:07:36,020 --> 00:07:38,780
They don't know the professional way to write an email.

90
00:07:38,780 --> 00:07:44,030
And you can change this situation with whatever situation you want.

91
00:07:44,030 --> 00:07:51,590
But let's see, let's say that we are a rookie sales person, and we want to convert our way of doing

92
00:07:51,590 --> 00:07:54,590
things into a professional way of doing things.

93
00:07:54,590 --> 00:08:01,370
So we in our way initially this day one, we will say please, please.

94
00:08:02,550 --> 00:08:03,570
Please.

95
00:08:05,790 --> 00:08:08,040
Mr. Customer.

96
00:08:10,800 --> 00:08:11,700
By.

97
00:08:12,820 --> 00:08:14,620
My product.

98
00:08:15,530 --> 00:08:15,770
Okay.

99
00:08:15,770 --> 00:08:21,980
So this is the the message that we would, uh, write on top of our mind, like, yeah, yeah, I want

100
00:08:21,980 --> 00:08:24,980
the customer to buy my product, but this is not a professional way.

101
00:08:24,980 --> 00:08:33,169
So we are going to use our application to rewrite this text in a more formal way.

102
00:08:33,169 --> 00:08:36,559
In American English, you see, we have different options.

103
00:08:36,559 --> 00:08:40,640
But right now the default options are formal and American English.

104
00:08:40,640 --> 00:08:49,850
In order to submit this input text, we are going to press the command text and enter okay command and

105
00:08:49,850 --> 00:08:50,450
enter.

106
00:08:50,450 --> 00:08:56,420
And as soon as we do that we have the application working for us.

107
00:08:56,420 --> 00:09:06,440
So as you see, the application has converted this slang or informal text into a more professional text.

108
00:09:06,440 --> 00:09:07,010
Okay.

109
00:09:07,010 --> 00:09:11,270
So let's see the code that is behind this application.

110
00:09:11,270 --> 00:09:14,780
First this file here Dsstore.

111
00:09:14,780 --> 00:09:15,830
Don't worry about them.

112
00:09:15,830 --> 00:09:18,110
These are default files.

113
00:09:18,110 --> 00:09:19,250
These are hidden files.

114
00:09:19,250 --> 00:09:21,470
You see the dot at the at the start.

115
00:09:21,470 --> 00:09:28,730
This is a hidden file that the Apple computers, the Mac computers create when you when you create a

116
00:09:28,730 --> 00:09:29,360
new folder.

117
00:09:29,360 --> 00:09:31,940
So don't worry, it goes into GitHub.

118
00:09:31,940 --> 00:09:39,860
But it's just a it's it's just it act if it was not here okay.

119
00:09:39,860 --> 00:09:41,270
So don't worry about it.

120
00:09:42,620 --> 00:09:43,310
Excuse me.

121
00:09:43,310 --> 00:09:46,760
So just focus on these two files.

122
00:09:47,270 --> 00:09:55,880
If you remember from from the previous lessons, we have one file that is telling a Streamlit what are

123
00:09:55,880 --> 00:10:01,460
the packages we are going to load in order to execute this application.

124
00:10:01,460 --> 00:10:06,260
And then we have the main file of the application with the main logic.

125
00:10:06,260 --> 00:10:06,920
Okay.

126
00:10:06,920 --> 00:10:14,450
These files you are going to download these files from the GitHub repository from our GitHub repository.

127
00:10:14,450 --> 00:10:21,680
So you will be able to a execute these files in your computer.

128
00:10:21,680 --> 00:10:28,730
So uh, once you do that you have any doubt in the process of downloading the, the, the, the files,

129
00:10:28,730 --> 00:10:36,290
you know, from the repository or executing this, uh, locally in your computer, go to ChatGPT or

130
00:10:36,320 --> 00:10:41,540
go to the Streamlit documentation, etc., etc. you know what to do, but let's review what we have

131
00:10:41,540 --> 00:10:41,810
here.

132
00:10:41,810 --> 00:10:42,320
First.

133
00:10:42,950 --> 00:10:52,850
In the requirements.txt file we have the three packages we are going to use Streamlit long chain and

134
00:10:52,850 --> 00:10:54,080
this long chain.

135
00:10:54,080 --> 00:10:55,130
OpenAI.

136
00:10:55,520 --> 00:11:01,430
As you know this is a new addition that we have included here.

137
00:11:01,430 --> 00:11:06,560
After the long chain 010 version was launched.

138
00:11:06,560 --> 00:11:07,040
Okay.

139
00:11:07,040 --> 00:11:08,660
Do you remember you remember that.

140
00:11:08,660 --> 00:11:13,700
So these are the three packages we are going to install.

141
00:11:13,700 --> 00:11:22,550
Well it's extremely which is going to install them for us in order to be able to execute the application.

142
00:11:22,550 --> 00:11:31,310
And in main.py py for Python this is a Python file is where we have the main logic of our application.

143
00:11:31,310 --> 00:11:39,770
And as you can see, apart from small details uh, coming from Streamlit, like for example, this one.

144
00:11:40,640 --> 00:11:42,530
Everything you are going to see here.

145
00:11:42,530 --> 00:11:43,850
You already know.

146
00:11:43,850 --> 00:11:47,840
So this is like an like a level one application.

147
00:11:47,840 --> 00:11:51,650
But in this case we have some little details.

148
00:11:51,650 --> 00:11:57,890
Uh, coming from Streamlit, for example, this first one, the first line you can imagine, you can

149
00:11:57,890 --> 00:11:59,840
guess what the first line is doing.

150
00:11:59,840 --> 00:12:02,690
It is importing the extremely package.

151
00:12:02,690 --> 00:12:13,580
And it is telling that a in the in this program, instead of writing a Streamlit, it is only going

152
00:12:13,580 --> 00:12:14,840
to write s t.

153
00:12:15,080 --> 00:12:20,780
Okay, so import Streamlit and just use s t for it.

154
00:12:20,780 --> 00:12:21,320
Okay.

155
00:12:21,320 --> 00:12:26,300
So you will see that in the in this program we are going to see this s t dot.

156
00:12:26,330 --> 00:12:28,850
This comes from Streamlit okay.

157
00:12:28,850 --> 00:12:36,260
So you are going to see the same things you have been seeing in the level one applications.

158
00:12:36,260 --> 00:12:43,400
You are familiar with this, you are familiar with this etc. but you are going to find some new things.

159
00:12:43,400 --> 00:12:48,380
For example, this thing here is a Python function.

160
00:12:49,340 --> 00:12:51,770
You have any doubts about Python function?

161
00:12:51,770 --> 00:12:56,810
Go to ChatGPT four, go to w3, schools.com, etc..

162
00:12:56,810 --> 00:12:58,700
Make make your homework.

163
00:12:58,700 --> 00:13:07,700
But what this Python function is doing is just encapsulating, uh, some long chain functionality.

164
00:13:07,700 --> 00:13:08,540
Why?

165
00:13:08,540 --> 00:13:17,420
Because a Streamlit wants to execute this logic in one particular moment.

166
00:13:17,420 --> 00:13:24,650
So when Streamlit is ready to do that, it is going to call this function okay.

167
00:13:25,700 --> 00:13:33,080
So this is one of the things you are going to see in the Streamlit applications, these functions encapsulating

168
00:13:33,080 --> 00:13:34,640
a long chain logic.

169
00:13:34,790 --> 00:13:39,290
Another thing you are going to see is this star whatever.

170
00:13:39,290 --> 00:13:44,720
So these are the like the format options of a Streamlit.

171
00:13:44,720 --> 00:13:47,840
So this is right in the page title.

172
00:13:47,840 --> 00:13:51,260
This is right in the header of the page etc..

173
00:13:51,260 --> 00:13:54,470
In this case here we are creating two columns.

174
00:13:55,100 --> 00:13:56,990
You remember these two columns.

175
00:13:56,990 --> 00:13:59,000
This is what we are creating there.

176
00:13:59,210 --> 00:14:09,620
And then you will see the the the typical A functionality you have seen in the previous blog with level

177
00:14:09,620 --> 00:14:10,820
one applications.

178
00:14:11,990 --> 00:14:14,180
The only different thing is that.

179
00:14:14,940 --> 00:14:23,850
At the end of the file you are going to find like the main commands, what is what this is saying is

180
00:14:23,850 --> 00:14:31,140
like okay, first check if the user has entered a proper OpenAI key.

181
00:14:31,170 --> 00:14:35,130
If not, send, you know, this error message or whatever.

182
00:14:35,250 --> 00:14:41,520
If we have a proper key, then go ahead and go ahead.

183
00:14:41,520 --> 00:14:45,810
First creating the LM by calling the function.

184
00:14:45,810 --> 00:14:49,140
And then you know the typical things we know from long chain.

185
00:14:49,170 --> 00:14:49,980
Okay.

186
00:14:49,980 --> 00:15:02,940
So as you see, to create a um, very good initial level two application, we only need one file and

187
00:15:02,940 --> 00:15:05,190
three packages.

188
00:15:05,190 --> 00:15:05,820
Okay.

189
00:15:05,820 --> 00:15:13,500
So now you go ahead download the code in the next in the next section in the next lesson you have the

190
00:15:13,500 --> 00:15:16,350
links to download the GitHub code.

191
00:15:16,350 --> 00:15:18,180
And you also have the URL.

192
00:15:18,180 --> 00:15:21,990
Play with the demo, download the code.

193
00:15:21,990 --> 00:15:23,970
Execute the code locally.

194
00:15:23,970 --> 00:15:31,260
As you know, you can execute an extremely application locally in your computer, and then you can load

195
00:15:31,260 --> 00:15:35,280
the application into your own GitHub repository.

196
00:15:35,980 --> 00:15:41,560
Once you have your application in your GitHub repository, and if you don't know how to create a GitHub

197
00:15:41,560 --> 00:15:44,170
repository, just ask ChatGPT for.

198
00:15:44,200 --> 00:15:45,190
It's very easy.

199
00:15:45,220 --> 00:15:52,540
Once you have your application in the GitHub repository, then you can create your own free account

200
00:15:52,540 --> 00:15:56,680
in the Streamlit Cloud Community Cloud.

201
00:15:56,680 --> 00:16:04,030
And once you create your free account there extremely, it is going to ask you to integrate your GitHub

202
00:16:04,030 --> 00:16:04,900
repository.

203
00:16:04,900 --> 00:16:06,040
It's just one click.

204
00:16:06,040 --> 00:16:07,090
It's just one button.

205
00:16:07,090 --> 00:16:08,470
Very easy to do.

206
00:16:08,500 --> 00:16:13,450
You have you have any problem ChatGPT four or extremely documentation or whatever.

207
00:16:13,690 --> 00:16:21,850
Once you have integrated GitHub and extremely cloud, then you can launch your own application in the

208
00:16:21,850 --> 00:16:22,450
cloud.

209
00:16:22,450 --> 00:16:22,900
Okay.

210
00:16:22,900 --> 00:16:30,880
And send the URL to to different people just for them to test your application and give you feedback,

211
00:16:30,880 --> 00:16:31,570
etc..

212
00:16:31,600 --> 00:16:32,410
Okay.

213
00:16:32,410 --> 00:16:38,500
So go ahead and start practicing with your first level two application.

214
00:16:38,500 --> 00:16:45,880
And remember don't uh, try to go uh too fast.

215
00:16:45,880 --> 00:16:54,400
Just find your own rhythm, repeat and practice until you feel comfortable with it, until you don't

216
00:16:54,400 --> 00:17:01,060
feel comfortable with this, uh, initial level two application, don't go to the next one.

