Dsxir. Demo
(dsxir v0.5.0)
Copy Markdown
A demo slotted into a predictor by an optimizer.
Wraps a %Dsxir.Example{} with a provenance tag. The chat adapter and the
json adapter render %Dsxir.Demo{} and %Dsxir.Example{} identically; the
tag is preserved across save/load via Dsxir.Artifact.
kind values:
:labeled- slotted directly from the trainset, no LM call.:bootstrapped- captured from a successfulDsxir.with_trace/1round run by an optimizer (e.g.Dsxir.Optimizer.BootstrapFewShot).
source is populated only for :bootstrapped demos and carries a provenance
map describing what produced the captured trace — e.g. the round and trainset
example index for Dsxir.Optimizer.BootstrapFewShot, or the originating
strategy for Dsxir.Optimizer.SIMBA.
Summary
Functions
Wrap ex as a bootstrapped demo captured from a successful trace round.
source is a provenance map describing what produced it (e.g. round and
trainset example index, or the originating optimizer strategy).
Wrap ex as a labeled demo (provenance: directly from the trainset).
Types
@type kind() :: :labeled | :bootstrapped
@type source() :: nil | map()
@type t() :: %Dsxir.Demo{example: Dsxir.Example.t(), kind: kind(), source: source()}
Functions
@spec bootstrapped(Dsxir.Example.t(), source()) :: t()
Wrap ex as a bootstrapped demo captured from a successful trace round.
source is a provenance map describing what produced it (e.g. round and
trainset example index, or the originating optimizer strategy).
@spec labeled(Dsxir.Example.t()) :: t()
Wrap ex as a labeled demo (provenance: directly from the trainset).