From the course: Level up LLM applications development with LangChain and OpenAI
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Create the chain: Prompt + model + parser
From the course: Level up LLM applications development with LangChain and OpenAI
Create the chain: Prompt + model + parser
- [Instructor] So the next demonstration is going to feel like a refresher. We're going to create a chain, we're going to compose the chain with multiple components in order to generate a response. So, here it's going to be a chain that I'm going to set as for now an empty string. But it's going to be a chain with a prompt, a model, and an output parser. So first we need to define the prompt. So let's go back up to find where we need to define the prompt. And here we define a template to tell the language model how to behave. And we want to tell the language models to act as a customer support specialist who can answer questions and assist users with general inquiries based on context. So we're going to start by defining the prompts, and we're going to do that first with a system message prompt template, like this. And we're going to do that with this class, which is system prompt template. And we need to initialize it by using this method, which is from_template, and we pass template…
Contents
-
-
-
-
-
(Locked)
RAG: Overview and architecture2m 12s
-
(Locked)
Breaking down the RAG pipeline2m 50s
-
(Locked)
Project setup3m 33s
-
(Locked)
Load and split documents into chunks5m 6s
-
(Locked)
Initialize a vector store (Chroma) and ingest documents5m 6s
-
(Locked)
Create the chain: Prompt + model + parser5m 39s
-
(Locked)
Create the chain: Add context with a retriever4m 48s
-
(Locked)
Pass data with RunnablePassthrough and query data3m 27s
-
Challenge: Create a custom agent with history3m 12s
-
Solution: Add a chain with chat history5m 19s
-
(Locked)
Solution: Context- and history-aware chatbot5m 49s
-
(Locked)
-
-
-
-
-
-
-
-