From the course: Prompt Engineering with LangChain
Unlock the full course today
Join today to access over 24,400 courses taught by industry experts.
Introduction to example selectors
From the course: Prompt Engineering with LangChain
Introduction to example selectors
- [Instructor] Example selectors in LangChain are classes that are responsible for selecting which examples to include in a prompt. They're useful when you have a large number of examples available, but need to select a subset of them to include in your prompt. Some key things to know about example selectors is that they implement a select_examples method, which takes in the input variables and returns a list of examples to include in the prompt. There are several different strategies for selecting examples. For example, you can select based on semantic similarity to the input, you can select based on maximal marginal relevance, so you can balance similarity and diversity using that. Or you can select based on prompt length. Example selectors allow prompts to dynamically choose examples based on the inputs rather than having fixed examples. They help you manage long prompts by only including the most relevant examples for the given inputs. New example selectors can be implemented…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
Introduction to prompt templates6m 31s
-
(Locked)
Multi-input prompt templates5m 9s
-
(Locked)
Chat prompt template5m 20s
-
(Locked)
Serializing prompts2m 52s
-
(Locked)
Zero-shot prompts5m 28s
-
(Locked)
Custom prompt templates7m 41s
-
(Locked)
Prompt pipelining5m 49s
-
(Locked)
Chat prompt pipelining3m 21s
-
(Locked)
Prompt composition4m 40s
-
(Locked)
Few-shot prompt templates8m 1s
-
(Locked)
Few-shot prompt templates for chat5m 10s
-
(Locked)
Introduction to example selectors2m 56s
-
(Locked)
Length-based example selector3m 9s
-
(Locked)
Max marginal relevance example selector4m 47s
-
(Locked)
N-gram overlap example selector5m 25s
-
(Locked)
Semantic similarity example selector2m 50s
-
(Locked)
Partial prompt templates4m 19s
-
-
-
-