Dsxir.Trace.Entry (dsxir v0.2.0)

Copy Markdown

One predictor invocation captured by Dsxir.with_trace/1.

An entry whose resolved inputs include any nil from an upstream optional skip is tagged degraded: true. Dsxir.Optimizer.BootstrapFewShot excludes degraded entries from its demo pool by default.

Summary

Functions

Normalise either a struct entry or a legacy 4-tuple into a struct.

Types

legacy_tuple()

@type legacy_tuple() ::
  {atom(), map(), Dsxir.Prediction.t(), [Dsxir.Demo.t() | Dsxir.Example.t()]}

t()

@type t() :: %Dsxir.Trace.Entry{
  degraded: boolean(),
  demos: [Dsxir.Demo.t() | Dsxir.Example.t()],
  inputs: map(),
  prediction: Dsxir.Prediction.t(),
  predictor: atom()
}

Functions

from(entry)

@spec from(t() | legacy_tuple()) :: t()

Normalise either a struct entry or a legacy 4-tuple into a struct.

Legacy tuples wrap with degraded: false. The shim exists so producers predating the struct (or third-party callers of Dsxir.Trace.record/1) continue to work without modification.