WEBVTT

00:00.000 --> 00:01.560
-: Over the next couple of lessons,

00:01.560 --> 00:05.250
we'll be looking at a package in Python called Lang Chain.

00:05.250 --> 00:07.410
Lang Chain is a Python package

00:07.410 --> 00:09.600
and also they have a JavaScript package,

00:09.600 --> 00:12.060
and what it allows you to do is easily interface

00:12.060 --> 00:15.450
with large language models such as open AI's GPT-4.

00:15.450 --> 00:16.860
It has a range of different modules

00:16.860 --> 00:19.170
that we'll be exploring such as Model I/O.

00:19.170 --> 00:22.440
Model I/O in this case means the inputs and outputs

00:22.440 --> 00:23.490
of our model.

00:23.490 --> 00:25.710
For the language model, that means looking at specific

00:25.710 --> 00:29.250
things such as prompt templates, so how can we add templates

00:29.250 --> 00:32.670
to give a language model the examples that we need.

00:32.670 --> 00:35.400
Also, as well as that it looks at how can we use

00:35.400 --> 00:38.070
different types of models, so the ones that we'll be

00:38.070 --> 00:40.530
specifically using are chat models,

00:40.530 --> 00:43.830
and we'll go through a installation on how you can easily

00:43.830 --> 00:44.730
use chat models.

00:44.730 --> 00:47.430
Finally, though, we need to get some structured data out

00:47.430 --> 00:48.990
of our large language models.

00:48.990 --> 00:51.630
It's important that we are able to extract

00:51.630 --> 00:54.510
structured data from large language models

00:54.510 --> 00:56.850
rather than just being able to extract text.

00:56.850 --> 00:59.280
This is where output passes will come in handy.

00:59.280 --> 01:03.060
We'll use these to extract serializable and deserializable

01:03.060 --> 01:07.170
objects from within Python using a package called Pidantic.

01:07.170 --> 01:09.270
You'll see the output passes allow us to go

01:09.270 --> 01:11.610
beyond just simply extracting text.

01:11.610 --> 01:14.940
We'll be able to extract structured data from the LLM,

01:14.940 --> 01:17.490
which you can use in your applications.

01:17.490 --> 01:20.280
Chains are a first class citizen in Lang Chain

01:20.280 --> 01:22.410
and you'll be exploring how to use chains

01:22.410 --> 01:25.170
to create more complicated architectures

01:25.170 --> 01:27.180
when you're using a large language model.

01:27.180 --> 01:28.890
There's lots of different types of chains

01:28.890 --> 01:31.440
and the reason why is that we can string these chains

01:31.440 --> 01:34.050
together to create lots of clever components

01:34.050 --> 01:36.150
when using large language models.

01:36.150 --> 01:39.780
We'll also look at things such as the retriever section

01:39.780 --> 01:43.140
and looking at how we can load documents using text,

01:43.140 --> 01:47.190
for example, so loading CSV files or mark down a PDF

01:47.190 --> 01:50.160
and how we can split these files so that you can easily

01:50.160 --> 01:53.070
interact with them inside of Lang Chain.

01:53.070 --> 01:55.410
This is due to the fact that some of your documents

01:55.410 --> 01:57.360
might be quite long and therefore we might

01:57.360 --> 01:59.310
need to do some sort of document splitting

01:59.310 --> 02:01.230
and document transformation.

02:01.230 --> 02:03.750
We'll also touch on the retriever section,

02:03.750 --> 02:06.600
which is how you can use different types of retrievers

02:06.600 --> 02:11.250
once you have ingested your documents to retrieve and search

02:11.250 --> 02:13.200
for different types of results.

02:13.200 --> 02:15.690
You'll investigate memory, which is a way for you

02:15.690 --> 02:19.890
to store the chat bot history inside of your code.

02:19.890 --> 02:22.080
This will be very useful if you're building chat bot

02:22.080 --> 02:24.600
applications or any application where there is

02:24.600 --> 02:27.090
a required amount of memory that needs to happen

02:27.090 --> 02:28.770
across multiple components.

02:28.770 --> 02:30.510
There's also callbacks as well.

02:30.510 --> 02:32.520
So there's a range of different things that we can use

02:32.520 --> 02:34.710
Lang Chain for, all the way from prompting

02:34.710 --> 02:37.020
and also working with documents that are too large

02:37.020 --> 02:39.120
to fit into a single LLM request.

02:39.120 --> 02:41.790
We'll explore specifically chat models

02:41.790 --> 02:45.060
and work through prompt templates looking at chains,

02:45.060 --> 02:47.373
retrieval methods, and much more.
