BaseExampleSelector#

class langchain_core.example_selectors.base.BaseExampleSelector[source]#

Interface for selecting examples to include in prompts.

Methods

__init__()

aadd_example(example)

Async add new example to store.

add_example(example)

Add new example to store.

aselect_examples(input_variables)

Async select which examples to use based on the inputs.

select_examples(input_variables)

Select which examples to use based on the inputs.

__init__()#
async aadd_example(example: dict[str, str]) Any[source]#

Async add new example to store.

Parameters:

example (dict[str, str]) – A dictionary with keys as input variables and values as their values.

Return type:

Any

abstract add_example(example: dict[str, str]) Any[source]#

Add new example to store.

Parameters:

example (dict[str, str]) – A dictionary with keys as input variables and values as their values.

Return type:

Any

async aselect_examples(input_variables: dict[str, str]) list[dict][source]#

Async select which examples to use based on the inputs.

Parameters:

input_variables (dict[str, str]) – A dictionary with keys as input variables and values as their values.

Return type:

list[dict]

abstract select_examples(input_variables: dict[str, str]) list[dict][source]#

Select which examples to use based on the inputs.

Parameters:

input_variables (dict[str, str]) – A dictionary with keys as input variables and values as their values.

Return type:

list[dict]

Examples using BaseExampleSelector