What is long serve and why it is important for us to be aware of this new.
A.
Solution provided by the long chain team.
So long, sir, is a one solution that is going to help us build an API for our LM application.
And this is going to be a situation that we are going to find frequently.
If you remember in a previous chapter, we have been talking about how to do this with a fast API directly,
but the long chain team has been working on a um, on their own solution to do that, and they call
it Lang Chef right now.
Lang Chef Lang serve as a a November of 2023 is still in beta version, but, uh, we expect that it,
uh, will uh, it will be better and better in order to, uh, provide more and more, uh, functionality
also in production right now, we can, uh, access to Lang serve via Jupyter notebook, via the editor,
like, uh, like Visual Studio Code or whatever editor you are using, and also via the terminal of
your computer.
In this exercise, we are going to provide a basic code for the Jupyter Notebook option.
And you will see at the end of the exercise some links to the playground to test the the application
and also the API routes, etc..
So in the right side of the screen you have the working goal for this.
Initially, as always, we connect with the dot m file where we have the credentials to uh, be able
to communicate with the API of OpenAI.
And then you will need to install some, uh, packages in your environment.
You will need to install Lang serve.
You will need to install this other packages and you will need to install also a this modules.
What we are doing here is we are creating a fast API application.
We are creating a couple of routes with slash OpenAI and slash chain.
And we are uh, creating the a local server.
So you will see that in the local server route.
We are going to have this content hello world.
And that we are going to start the, uh, server in this, uh, location.
So if you go to the a initial link to the, you will, you will see the playground to check the app.
Then you have the API routes in slash OpenAI and slash chain.
And finally you have the fast API, API documentation okay.
So here's where you can start playing around with all these, uh, possibilities.
So as you see, it's a very similar solution to the one we, uh, initially try with Fetch Fast API
in a previous chapter, this is the option that Lang Chain is going to, uh, promote, uh, looking
at the future, and we expect that it will be better and more complete and with more possibilities in
the near future.
So for you, it's important, in my opinion, to check the Lang Smith documentation about it and start
preparing yourself for the moment where Lang server is out of beta.
So it's it's like a solid solution.