# Select by length

This example selector selects which examples to use based on length. This is useful when you are worried about constructing a prompt that will go over the length of the context window. For longer inputs, it will select fewer examples to include, while for shorter inputs it will select more.

import Example from "@snippets/modules/model_io/prompts/example_selectors/length_based.mdx"

<Example/>
