-: Over the next couple of lessons,
we'll be looking at a package in Python called Lang Chain.
Lang Chain is a Python package
and also they have a JavaScript package,
and what it allows you to do is easily interface
with large language models such as open AI's GPT-4.
It has a range of different modules
that we'll be exploring such as Model I/O.
Model I/O in this case means the inputs and outputs
of our model.
For the language model, that means looking at specific
things such as prompt templates, so how can we add templates
to give a language model the examples that we need.
Also, as well as that it looks at how can we use
different types of models, so the ones that we'll be
specifically using are chat models,
and we'll go through a installation on how you can easily
use chat models.
Finally, though, we need to get some structured data out
of our large language models.
It's important that we are able to extract
structured data from large language models
rather than just being able to extract text.
This is where output passes will come in handy.
We'll use these to extract serializable and deserializable
objects from within Python using a package called Pidantic.
You'll see the output passes allow us to go
beyond just simply extracting text.
We'll be able to extract structured data from the LLM,
which you can use in your applications.
Chains are a first class citizen in Lang Chain
and you'll be exploring how to use chains
to create more complicated architectures
when you're using a large language model.
There's lots of different types of chains
and the reason why is that we can string these chains
together to create lots of clever components
when using large language models.
We'll also look at things such as the retriever section
and looking at how we can load documents using text,
for example, so loading CSV files or mark down a PDF
and how we can split these files so that you can easily
interact with them inside of Lang Chain.
This is due to the fact that some of your documents
might be quite long and therefore we might
need to do some sort of document splitting
and document transformation.
We'll also touch on the retriever section,
which is how you can use different types of retrievers
once you have ingested your documents to retrieve and search
for different types of results.
You'll investigate memory, which is a way for you
to store the chat bot history inside of your code.
This will be very useful if you're building chat bot
applications or any application where there is
a required amount of memory that needs to happen
across multiple components.
There's also callbacks as well.
So there's a range of different things that we can use
Lang Chain for, all the way from prompting
and also working with documents that are too large
to fit into a single LLM request.
We'll explore specifically chat models
and work through prompt templates looking at chains,
retrieval methods, and much more.