Runtime evaluation, bounded concurrent batch execution, two-tier (L1 + L2) cache
orchestration, and deterministic test stubbing for SystemOneDSL contract modules backed by
ReqLLM.Evaluation.
Telemetry Events
SystemOneDSL.Runner emits :telemetry.span/3 events:
[:system_one_dsl, :evaluate, :start | :stop | :exception][:system_one_dsl, :evaluate_many, :start | :stop | :exception]
Summary
Functions
Resolves the trimmed API key from opts, application config, or environment.
Returns true if the contract module can execute evaluations — either via an injected
1-arity test function (:eval_fn or :eval_fn_key), a configured API key, a test plug
in :req_http_options, or an enabled Tier-2 cache (:tier2_cache).
Builds the strict ReqLLM.Evaluation keyword option list from SystemOneDSL merged options.
Computes the deterministic SHA-256 cache key ("jev_<sha256>") using the contract
module's merged options (use SystemOneDSL + otp_app config + call overrides).
Evaluates a single state map against contract_key defined in contract_mod.
Evaluates a single state map against contract_key or raises SystemOneDSL.Error.
Evaluates a list of states concurrently against contract_key using bounded
Task.async_stream/3 (:max_concurrency default 10, ordered: true).
Resolves L1 and L2 cache hits first and only dispatches uncached misses over the network.
Returns true if a non-empty API key is available.
Functions
Resolves the trimmed API key from opts, application config, or environment.
Returns true if the contract module can execute evaluations — either via an injected
1-arity test function (:eval_fn or :eval_fn_key), a configured API key, a test plug
in :req_http_options, or an enabled Tier-2 cache (:tier2_cache).
Builds the strict ReqLLM.Evaluation keyword option list from SystemOneDSL merged options.
Computes the deterministic SHA-256 cache key ("jev_<sha256>") using the contract
module's merged options (use SystemOneDSL + otp_app config + call overrides).
@spec evaluate(module(), atom() | String.t(), map(), keyword()) :: {:ok, ReqLLM.Response.t() | map()} | {:error, term()}
Evaluates a single state map against contract_key defined in contract_mod.
Evaluates a single state map against contract_key or raises SystemOneDSL.Error.
@spec evaluate_many(module(), atom() | String.t(), [map()], keyword()) :: [ ok: ReqLLM.Response.t() | map(), error: term() ]
Evaluates a list of states concurrently against contract_key using bounded
Task.async_stream/3 (:max_concurrency default 10, ordered: true).
Resolves L1 and L2 cache hits first and only dispatches uncached misses over the network.
Returns true if a non-empty API key is available.