1
00:00:02,820 --> 00:00:09,930
What is long serve and why it is important for us to be aware of this new.

2
00:00:11,240 --> 00:00:12,050
A.

3
00:00:12,700 --> 00:00:16,059
Solution provided by the long chain team.

4
00:00:16,720 --> 00:00:26,020
So long, sir, is a one solution that is going to help us build an API for our LM application.

5
00:00:26,020 --> 00:00:30,910
And this is going to be a situation that we are going to find frequently.

6
00:00:30,910 --> 00:00:40,180
If you remember in a previous chapter, we have been talking about how to do this with a fast API directly,

7
00:00:40,330 --> 00:00:49,450
but the long chain team has been working on a um, on their own solution to do that, and they call

8
00:00:49,450 --> 00:00:51,730
it Lang Chef right now.

9
00:00:51,760 --> 00:01:03,940
Lang Chef Lang serve as a a November of 2023 is still in beta version, but, uh, we expect that it,

10
00:01:03,940 --> 00:01:12,670
uh, will uh, it will be better and better in order to, uh, provide more and more, uh, functionality

11
00:01:12,880 --> 00:01:21,970
also in production right now, we can, uh, access to Lang serve via Jupyter notebook, via the editor,

12
00:01:21,970 --> 00:01:28,720
like, uh, like Visual Studio Code or whatever editor you are using, and also via the terminal of

13
00:01:28,720 --> 00:01:29,740
your computer.

14
00:01:29,740 --> 00:01:37,420
In this exercise, we are going to provide a basic code for the Jupyter Notebook option.

15
00:01:37,420 --> 00:01:44,770
And you will see at the end of the exercise some links to the playground to test the the application

16
00:01:44,770 --> 00:01:47,350
and also the API routes, etc..

17
00:01:47,350 --> 00:01:52,840
So in the right side of the screen you have the working goal for this.

18
00:01:52,840 --> 00:02:00,010
Initially, as always, we connect with the dot m file where we have the credentials to uh, be able

19
00:02:00,010 --> 00:02:02,800
to communicate with the API of OpenAI.

20
00:02:03,190 --> 00:02:09,370
And then you will need to install some, uh, packages in your environment.

21
00:02:09,370 --> 00:02:11,290
You will need to install Lang serve.

22
00:02:11,320 --> 00:02:18,640
You will need to install this other packages and you will need to install also a this modules.

23
00:02:18,640 --> 00:02:23,410
What we are doing here is we are creating a fast API application.

24
00:02:23,410 --> 00:02:29,320
We are creating a couple of routes with slash OpenAI and slash chain.

25
00:02:29,620 --> 00:02:34,930
And we are uh, creating the a local server.

26
00:02:34,930 --> 00:02:39,490
So you will see that in the local server route.

27
00:02:39,490 --> 00:02:42,310
We are going to have this content hello world.

28
00:02:42,310 --> 00:02:49,030
And that we are going to start the, uh, server in this, uh, location.

29
00:02:49,030 --> 00:02:57,370
So if you go to the a initial link to the, you will, you will see the playground to check the app.

30
00:02:57,370 --> 00:03:02,320
Then you have the API routes in slash OpenAI and slash chain.

31
00:03:02,320 --> 00:03:07,720
And finally you have the fast API, API documentation okay.

32
00:03:07,720 --> 00:03:12,280
So here's where you can start playing around with all these, uh, possibilities.

33
00:03:12,280 --> 00:03:21,280
So as you see, it's a very similar solution to the one we, uh, initially try with Fetch Fast API

34
00:03:21,280 --> 00:03:28,780
in a previous chapter, this is the option that Lang Chain is going to, uh, promote, uh, looking

35
00:03:28,780 --> 00:03:35,140
at the future, and we expect that it will be better and more complete and with more possibilities in

36
00:03:35,140 --> 00:03:35,890
the near future.

37
00:03:35,890 --> 00:03:43,120
So for you, it's important, in my opinion, to check the Lang Smith documentation about it and start

38
00:03:43,120 --> 00:03:47,950
preparing yourself for the moment where Lang server is out of beta.

39
00:03:47,950 --> 00:03:51,160
So it's it's like a solid solution.

