SyniInferenceMetric class
Typed view over the runtime's telemetry snapshot (syni_telemetry_json).
Parsing is defensive: unknown / missing / wrong-typed fields degrade to
sensible defaults rather than throwing, so a runtime that adds fields (or an
older one that omits them) never breaks the SDK.
One recorded on-device inference. Mirrors the runtime's InferenceMetrics.
Constructors
- SyniInferenceMetric({required int startedAtUnixMs, required int durationMs, required String preset, required bool success, required bool schemaValid, required int retries, required bool fallbackUsed, String? requestId, String? errorCode, String? fallbackReason, SyniFallbackDiagnostics? diagnostics, SyniPhaseStats? phases})
-
const
-
SyniInferenceMetric.fromMap(Map<
String, dynamic> m) -
factory
Properties
- diagnostics → SyniFallbackDiagnostics?
-
Root-cause debugging context — present only on a fallback.
final
- durationMs → int
-
final
- errorCode → String?
-
Stable code the fallback papered over (
TIMEOUT,SCHEMA, …), or null.final - fallbackReason → String?
-
Raw reason paired with errorCode, or null.
final
- fallbackUsed → bool
-
Whether a deterministic fallback was substituted for model output.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- phases → SyniPhaseStats?
-
Prompt reading (prefill) and answer writing (decode), timed apart, or
null when the runtime does not report them (before syni-runtime 0.7).
final
- preset → String
-
final
- requestId → String?
-
Correlates this metric with a V2 turn response, or null for legacy calls.
final
- retries → int
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- schemaValid → bool
-
final
- startedAtUnixMs → int
-
final
- success → bool
-
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited