langchain.prompts.example_selector.base.BaseExampleSelector¶
class langchain.prompts.example_selector.base.BaseExampleSelector[source]¶
Interface for selecting examples to include in prompts.
Methods
__init__()
add_example(example)
Add new example to store for a key.
select_examples(input_variables)
Select which examples to use based on the inputs.
__init__()¶
abstract add_example(example: Dict[str, str]) → Any[source]¶
Add new example to store for a key.
abstract select_examples(input_variables: Dict[str, str]) → List[dict][source]¶
Select which examples to use based on the inputs.
Examples using BaseExampleSelector¶
Custom example selector