Tune.Optimizers.LabeledFewShot (Tune v0.5.0)

Copy Markdown View Source

Uses up to k complete labeled training examples as demonstrations for each predictor. Makes no model calls.

An example supplies a demonstration for a predictor when its inputs and labels contain every field of that predictor's signature and the values are valid. With sample: true (the default) examples are sampled without replacement using local seeded random state; otherwise the first k are used.

Options: :k (default 16), :sample (default true).

Differences from DSPy: the build is unscored and returns no validation improvement claim; predictors without complete labeled examples keep no demos.