oracular / inspect
Function: inspect()
ts
function inspect(
state,
at,
opts?
): Snapshot;Defined in: evaluate.ts:74
evaluate for every declared intent at once, in config order: the whole engine's view at one moment, as plain data. This is what to log, assert on, or hand to renderInspector from oracular/inspect for a live panel. Read-only.
Parameters
| Parameter | Type | Description |
|---|---|---|
state | EngineState | The current state. Not mutated. |
at | number | The time to evaluate at. |
opts? | EvaluateOptions | Reveal overrides and explain filters, applied to every intent. |
Returns
at and one IntentSnapshot per intent.
Throws
TypeError when state is not an engine state, at is not finite, or opts is malformed.
Example
ts
for (const { intent, prediction, reveal } of inspect(state, Date.now()).intents) {
console.log(intent, prediction.p.toFixed(3), reveal ? 'reveal' : '');
}