Package-level declarations
Types
Lightweight, on-device assistant metrics (SoT §36/§37). Tracks how often the deterministic path handles a request vs. how often we fall back to the model, plus model latency — so we can verify "deterministic commands cost 0 LLM calls" and later judge whether prefix-caching actually helps. No data leaves the device; only aggregate counters are logged.
The chat template the downloaded model was trained with.
On-device text generation via MediaPipe LLM Inference, backed by whatever .task model the user downloaded (Qwen, Gemma, …) — fully local, no network at inference time.
Streams a model file to local storage with progress. Follows redirects manually so a Hugging Face resolve URL (which 302s to a signed CDN link) works, and only sends the auth token to the first host — never to the CDN.
Functions
Asks the model for a one-word verdict; anything unparseable is InputKind.UNCLEAR.
Model-driven decision: given a text generator, ask the model to pick one or more actions. The prompt is generated from the capability CAPABILITIES catalog and grounded with the actual installed apps that look relevant, so the model selects a real app instead of guessing a name. The model decides; we only parse + execute.
Cycle-2 call: the model names the pairs; empty on a dud reply.
Builds the Assistant over the downloaded model, or null if AI is off or no model is set up.