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:

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

kind()

@type kind() :: :labeled | :bootstrapped

source()

@type source() :: nil | map()

t()

@type t() :: %Dsxir.Demo{example: Dsxir.Example.t(), kind: kind(), source: source()}

Functions

bootstrapped(ex, source)

@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).

labeled(ex)

@spec labeled(Dsxir.Example.t()) :: t()

Wrap ex as a labeled demo (provenance: directly from the trainset).