activeModelSpec property

InferenceModelSpec? get activeModelSpec

The active inference model's identity (its InferenceModelSpec), or null if none is set. Cheap synchronous read — does NOT load the engine (use getActiveModel for that). hasActiveModel() == (activeModelSpec != null).

Implementation

static InferenceModelSpec? get activeModelSpec {
  final spec = FlutterGemmaPlugin.instance.modelManager.activeInferenceModel;
  if (spec == null || spec is InferenceModelSpec) {
    return spec as InferenceModelSpec?;
  }
  gemmaLog(
    'activeModelSpec: active inference slot holds a ${spec.runtimeType}, '
    'not an InferenceModelSpec — returning null (invariant violation).',
  );
  return null;
}