Synaptic.Scorer behaviour (synaptic v0.2.6)

View Source

Behaviour and helper types for step-level scoring in Synaptic workflows.

A scorer evaluates the outcome of a workflow step and returns a normalized score (typically between 0.0 and 1.0), along with optional human-readable reasoning and arbitrary details.

Scorers are attached to steps via the workflow DSL and are invoked automatically by Synaptic.Runner after a step completes successfully.

Summary

Types

A scorer module evaluates a step given a Synaptic.Scorer.Context and returns a Synaptic.Scorer.Result.

Types

scorer_spec()

@type scorer_spec() ::
  module() | {module(), keyword()} | %{module: module(), opts: keyword()}

A scorer module evaluates a step given a Synaptic.Scorer.Context and returns a Synaptic.Scorer.Result.

Callbacks

score(t, metadata)

@callback score(Synaptic.Scorer.Context.t(), metadata :: map()) ::
  Synaptic.Scorer.Result.t()