So this is going to be the first level two application you are going to learn how to develop.
This is the user interface that you will create with Streamlit.
This is a very simple application.
The purpose of this application is to rewrite the text that the user enters here in a more formal way,
and in fact, you have different choices.
You can you can change the text to a more formal way or more informal way, or in a American English
or British English or whatever.
So very simple application.
The interesting thing for you, uh, while practicing this exercise is to look at the, you know, the
design elements, like, for example, this drop downs, uh, or the columns you see here, one column,
two columns, or, you know, the font sizes you have here, you know, or these forms, you know,
input forms where the user can introduce a text.
Okay.
So remember level two applications are toy demos with toy user interfaces.
They are still not professional applications.
They are still what we call prototypes, proof of concepts.
But as you can see, a level two applications are very different for from the level one applications
we have created.
Because when you go to a potential user or to your manager or a potential, um, customer or whatever,
with this prototype, you are going to have a very different response than if you go with a level one
application, right?
Just with the lines of code.
So here the user can imagine a real application.
As you know, the purpose of this, uh, prototypes is to get feedback from the user.
The user is going to tell you that the potential user is going to tell you, okay, I like this.
I don't like this.
We need this other thing.
This is a mistake.
You need to rethink what you are doing here or there or whatever.
Okay.
So once you have this feedback you will then prepare your professional level application what we call
level three application okay.
So remember we are in a bootcamp.
And at this stage the most important thing you can do is to practice, practice, practice.
We are not going to write line by line the code with you.
We are going to provide you the URL of the A this application in Streamlit.
We are going to provide you the code, uh, in the GitHub repository, so you can download the code
and execute the code in your computer.
But we are going to a let it in your hands.
So it is going to be you the person that has to.
Experiment.
Try.
Make mistakes.
Ask questions to ChatGPT for whenever you have a doubt or a problem, go to extremely tutorial.
Go to the W3 schools.com page.
Go to the lunch and documentation.
Go to the previous blog where you have been building level one applications and review your code there
and try the code here, etc..
Right?
So remember this is a bootcamp.
You have a lot of responsibility and this is in fact very good for you because we are showing you how
a real artificial intelligence engineer works on a daily basis.
So if you are new to this, maybe this is going to feel a little bit uncomfortable for you at the beginning,
but you will see it is going to prepare you for the real world, for the real profession of, uh, artificial
intelligence engineers.
If you are a business executive, if you are a following, this, uh, bootcamp, just in order to hire
a team of engineers or hire a consulting firm to develop your applications or whatever, this this a
blog can be a different approach for you.
So maybe for you, it would be okay just to follow these lessons in a faster way without so many practice.
You know, just to understand how an artificial intelligence engineer works.
But even if you are a business executive, I would recommend you to practice with these exercises because
I think they are going.
The practice is going to make you understand better how an artificial intelligence engineers really
work, and for the rest of us, for the, for all the the practitioners, for all the people that wants
to become artificial intelligence engineers, I encourage you practice, practice, practice.
We are going to give you all the tools and all the guidance, but at the end it is you practicing until
you feel comfortable with each exercise.
So for some people this is going to mean 15 minutes, for some others it's going to see it's going to
be three hours, for others would be 6 hours or 10 hours.
Don't worry about it.
Don't feel stress.
If you need more time initially, just repeat and experiment and use your personal assistant ChatGPT
for to.
Progress, to learn, to understand.
Make more questions.
Repeat again, again until you feel comfortable.
Remember, the important thing is that you complete this bootcamp at your own rhythm, at that rhythm
that feels comfortable for you and that works for you.
Okay, so.
We are going to demo this application.
The first thing we are going to do is we are going to enter.
Our OpenAI API key as if we were a user.
Okay, so if we click on the I icon there, you will visualize our key.
That is not a good idea.
So instead we are going to press enter to apply.
And once we have done this we can enter the text we want to rewrite here.
So let's say for example that this user is a new sales person in our company and is the first day in
their career, you know, and they are really scared about writing an email to a customer.
They don't know the professional way to write an email.
And you can change this situation with whatever situation you want.
But let's see, let's say that we are a rookie sales person, and we want to convert our way of doing
things into a professional way of doing things.
So we in our way initially this day one, we will say please, please.
Please.
Mr. Customer.
By.
My product.
Okay.
So this is the the message that we would, uh, write on top of our mind, like, yeah, yeah, I want
the customer to buy my product, but this is not a professional way.
So we are going to use our application to rewrite this text in a more formal way.
In American English, you see, we have different options.
But right now the default options are formal and American English.
In order to submit this input text, we are going to press the command text and enter okay command and
enter.
And as soon as we do that we have the application working for us.
So as you see, the application has converted this slang or informal text into a more professional text.
Okay.
So let's see the code that is behind this application.
First this file here Dsstore.
Don't worry about them.
These are default files.
These are hidden files.
You see the dot at the at the start.
This is a hidden file that the Apple computers, the Mac computers create when you when you create a
new folder.
So don't worry, it goes into GitHub.
But it's just a it's it's just it act if it was not here okay.
So don't worry about it.
Excuse me.
So just focus on these two files.
If you remember from from the previous lessons, we have one file that is telling a Streamlit what are
the packages we are going to load in order to execute this application.
And then we have the main file of the application with the main logic.
Okay.
These files you are going to download these files from the GitHub repository from our GitHub repository.
So you will be able to a execute these files in your computer.
So uh, once you do that you have any doubt in the process of downloading the, the, the, the files,
you know, from the repository or executing this, uh, locally in your computer, go to ChatGPT or
go to the Streamlit documentation, etc., etc. you know what to do, but let's review what we have
here.
First.
In the requirements.txt file we have the three packages we are going to use Streamlit long chain and
this long chain.
OpenAI.
As you know this is a new addition that we have included here.
After the long chain 010 version was launched.
Okay.
Do you remember you remember that.
So these are the three packages we are going to install.
Well it's extremely which is going to install them for us in order to be able to execute the application.
And in main.py py for Python this is a Python file is where we have the main logic of our application.
And as you can see, apart from small details uh, coming from Streamlit, like for example, this one.
Everything you are going to see here.
You already know.
So this is like an like a level one application.
But in this case we have some little details.
Uh, coming from Streamlit, for example, this first one, the first line you can imagine, you can
guess what the first line is doing.
It is importing the extremely package.
And it is telling that a in the in this program, instead of writing a Streamlit, it is only going
to write s t.
Okay, so import Streamlit and just use s t for it.
Okay.
So you will see that in the in this program we are going to see this s t dot.
This comes from Streamlit okay.
So you are going to see the same things you have been seeing in the level one applications.
You are familiar with this, you are familiar with this etc. but you are going to find some new things.
For example, this thing here is a Python function.
You have any doubts about Python function?
Go to ChatGPT four, go to w3, schools.com, etc..
Make make your homework.
But what this Python function is doing is just encapsulating, uh, some long chain functionality.
Why?
Because a Streamlit wants to execute this logic in one particular moment.
So when Streamlit is ready to do that, it is going to call this function okay.
So this is one of the things you are going to see in the Streamlit applications, these functions encapsulating
a long chain logic.
Another thing you are going to see is this star whatever.
So these are the like the format options of a Streamlit.
So this is right in the page title.
This is right in the header of the page etc..
In this case here we are creating two columns.
You remember these two columns.
This is what we are creating there.
And then you will see the the the typical A functionality you have seen in the previous blog with level
one applications.
The only different thing is that.
At the end of the file you are going to find like the main commands, what is what this is saying is
like okay, first check if the user has entered a proper OpenAI key.
If not, send, you know, this error message or whatever.
If we have a proper key, then go ahead and go ahead.
First creating the LM by calling the function.
And then you know the typical things we know from long chain.
Okay.
So as you see, to create a um, very good initial level two application, we only need one file and
three packages.
Okay.
So now you go ahead download the code in the next in the next section in the next lesson you have the
links to download the GitHub code.
And you also have the URL.
Play with the demo, download the code.
Execute the code locally.
As you know, you can execute an extremely application locally in your computer, and then you can load
the application into your own GitHub repository.
Once you have your application in your GitHub repository, and if you don't know how to create a GitHub
repository, just ask ChatGPT for.
It's very easy.
Once you have your application in the GitHub repository, then you can create your own free account
in the Streamlit Cloud Community Cloud.
And once you create your free account there extremely, it is going to ask you to integrate your GitHub
repository.
It's just one click.
It's just one button.
Very easy to do.
You have you have any problem ChatGPT four or extremely documentation or whatever.
Once you have integrated GitHub and extremely cloud, then you can launch your own application in the
cloud.
Okay.
And send the URL to to different people just for them to test your application and give you feedback,
etc..
Okay.
So go ahead and start practicing with your first level two application.
And remember don't uh, try to go uh too fast.
Just find your own rhythm, repeat and practice until you feel comfortable with it, until you don't
feel comfortable with this, uh, initial level two application, don't go to the next one.