Module example_selectors

Source
Expand description

Example selectors for FerricLink Core.

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.

Example selectors are crucial for:

  • Few-shot learning and prompting
  • Dynamic prompt construction
  • Semantic similarity-based example selection
  • Length-based prompt management
  • Max Marginal Relevance algorithms

Structs§

LengthBasedExampleSelector
Select examples based on length.
MaxMarginalRelevanceExampleSelector
Select examples based on Max Marginal Relevance (MMR).
SemanticSimilarityExampleSelector
Select examples based on semantic similarity using vector stores.

Traits§

BaseExampleSelector
Interface for selecting examples to include in prompts.

Functions§

sorted_values
Utility function to return values in a dictionary sorted by key.

Type Aliases§

Example
A type alias for example data