example_selectors#

Example selector implements logic for selecting examples to include them in prompts. This allows us to select examples that are most relevant to the input.

Classes

example_selectors.base.BaseExampleSelector()

Interface for selecting examples to include in prompts.

example_selectors.length_based.LengthBasedExampleSelector

Select examples based on length.

example_selectors.semantic_similarity.MaxMarginalRelevanceExampleSelector

Select examples based on Max Marginal Relevance.

example_selectors.semantic_similarity.SemanticSimilarityExampleSelector

Select examples based on semantic similarity.

Functions

example_selectors.semantic_similarity.sorted_values(values)

Return a list of values in dict sorted by key.