SystemOneDSL.Prepared (SystemOneDSL v1.0.0)

Copy Markdown View Source

Compile-time prepared evaluation contract holding normalized ReqLLM.Evaluation question maps and a deterministic SHA-256 fingerprint.

Summary

Functions

Computes a deterministic SHA-256 hex fingerprint for a normalized questions map.

Normalizes a list of %SystemOneDSL.Question{} structs (or keyword/map of question maps) into a %SystemOneDSL.Prepared{} struct with a deterministic SHA-256 fingerprint.

Same as prepare/1, but raises SystemOneDSL.Error on invalid questions.

Types

t()

@type t() :: %SystemOneDSL.Prepared{
  fingerprint: String.t(),
  questions: %{optional(atom() | String.t()) => map()}
}

Functions

compute_fingerprint(questions)

@spec compute_fingerprint(map()) :: String.t()

Computes a deterministic SHA-256 hex fingerprint for a normalized questions map.

prepare(questions)

@spec prepare([SystemOneDSL.Question.t()] | keyword() | map()) ::
  {:ok, t()} | {:error, SystemOneDSL.Error.t()}

Normalizes a list of %SystemOneDSL.Question{} structs (or keyword/map of question maps) into a %SystemOneDSL.Prepared{} struct with a deterministic SHA-256 fingerprint.

prepare!(questions)

@spec prepare!([SystemOneDSL.Question.t()] | keyword() | map()) :: t()

Same as prepare/1, but raises SystemOneDSL.Error on invalid questions.