FakeOnDeviceLlm
A scriptable OnDeviceLlm test double — no real model, no device, no :ai backend SDK — so any app can exercise its own AI-branching (a success string, a typed AiFailure, a chunked stream) without shipping a 500MB model or needing AICore-class hardware just to run its tests.
Queue as many outcomes as a test needs with enqueueSuccess/enqueueFailure/ enqueueStreamChunks — each generate/generateStream call consumes the next queued entry, in order. Once the queue runs dry the LAST entry keeps repeating, so a test that only cares about the first call doesn't have to script every call that follows it. An empty queue answers AiFailure.EmptyReply (a call) / an empty stream — the same shape a real backend gives back when it has nothing to say, rather than throwing on an un-scripted test.
Constructors
Functions
The next generateStream call emits chunks in order, one per element, then completes.
Flips what isAvailable (and, absent setCapabilities, the inherited capabilities) reports.
Overrides capabilities outright — otherwise it derives from isAvailable, same as the real default.