Check out a free preview of the full First Look: ChatGPT API for Web Developers course

The "Langchain" Lesson is part of the full, First Look: ChatGPT API for Web Developers course featured in this preview video. Here's what you'd learn in this lesson:

Maximiliano discusses utilizing the Langchain framework to continue to learn about developing LLM applications.

Preview
Close

Transcript from the "Langchain" Lesson

[00:00:00]
>> If you wanna get further into this, I encourage you to learn about Langchain. Langchain is a framework for developing applications powered by LLMs. And Langchain has libraries for Python, and no JS and JavaScript. And it's multi-vendor, so it's not just for open AI. You can connect also with other models, other AI models.

[00:00:24]
It includes prompt tools, so the prompt, the string you know it has a lot of places there so you can create templates. So you can say well here it will go the example, this is what I need if something's wrong. It include, this is the part where you can use embeddings.

[00:00:42]
It includes document loaders, so you can upload a PDF with this and he will do that chunk part of it with a slice your document, and he will start your vectors. It does include text splitters that will split your document in chunks. By the way, long chain will use your open AI key.

[00:01:02]
Because they are not doing that for you. They have memory. So they support the idea of memory between calls. So instead of using directly the OpenAPI as we were using, you can use Langchain and then Langchain will have memory, and we remember the history chat. And it will inject that into the prompt for all their requests.

[00:01:27]
And the name lang from LLMs, language models, and chain. Chain, it's an interface included in this library that will let you connect different AI calls. So you can say, I want to make this call. Then Dolly, then after Dolly, I want to go to another model, then I want to use church CBT for something else, and you can express all that chain and then execute the chain.

[00:01:55]
And finally, it includes an idea known as agents. An agent is to make decisions on actions to take based on JPT then the agent will take the action. It can be sent an email. It can be called an API, copy a folder. It can be something on your computer, open software, used the software, click here or there and it can even observe.

[00:02:25]
For that action to control that happen or not he will retry. And for that it uses a lot of calls to open AIs, APIs. So that's long chain, the website is js.langchain.com. That's the one that goes directly to the JavaScript API. And here you have all the documentation on how to start using LLMs.

[00:02:54]
And here you can see how to use the chat models from open AI and other providers in the future. How to all the tools for prompts. So output parser, for example, it will check that the format that the LLM is returning is exactly the one you were expecting.

[00:03:12]
So it's a body data of the output. Indexes is where you have document loaders. Vector stores that will help you with that part to split the document and then create the embedding for you. So, Langchain is like the next step. So, after you learn the basics of OpenAI, the next step is probably use a framework such as Langchain.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now