Skip to main content
Open on GitHub

Example selectors

Overview​

One common prompting technique for achieving better performance is to include examples as part of the prompt. This is known as few-shot prompting.

This gives the language model concrete examples of how it should behave. Sometimes these examples are hardcoded into the prompt, but for more advanced situations it may be nice to dynamically select them.

Example Selectors are classes responsible for selecting and then formatting examples into prompts.


Was this page helpful?