Skip to contents

Get the few-shot demonstration examples from a compiled module. Returns the demos that were selected during optimization (e.g., by LabeledFewShot or BootstrapFewShot teleprompters).

Usage

best_demos(module, as_tibble = FALSE)

Arguments

module

A DSPrrr module that has been compiled with demos.

as_tibble

Logical; if TRUE, return demos as a tibble. If FALSE (default), return as a list.

Value

A list or tibble of demonstration examples, or NULL if the module has no demos.

Examples

if (FALSE) {
tp <- LabeledFewShot(k = 4L)
compiled <- compile(tp, mod, trainset)
demos <- best_demos(compiled)
}