A single predicate over one metadata field. Sealed because the storage
codec needs to switch over the concrete subtype — adding a new condition
without updating the codec would silently drop it.
metadata[key] in values set membership. Equivalent to N FieldEquals
wrapped in a should bucket, but expressed in one place and serialized
more efficiently on the storage side.
Low-level platform-interface tier (the federated-plugin SPI) for
flutter_gemma. It hosts the abstract runtime types (InferenceModel,
InferenceModelSession, InferenceChat, EmbeddingModel,
SpeechRecognizer, SpeechSynthesizer, …) and the platform-dispatch
singleton instance.
RAG (retrieval-augmented generation) operations, reached via
FlutterGemma.rag. Thin, stateless delegator over the vector store;
opt-in (see FlutterGemma.rag). Modelled as a single const instance
purely to give the operations a rag. namespace on the facade — it holds
no state and is not itself a test seam. To fake RAG in tests, substitute
FlutterGemmaPlugin.instance (which every method here delegates to).
Comprehensive error handling and debugging utilities for AI image processing
to prevent corruption that causes repeating text patterns in model responses.
Handles proper image tokenization for multimodal AI models to prevent
"Prompt contained 0 image tokens but received 1 images" errors and
corruption that causes repeating text patterns.
Holds skill executors registered via FlutterGemma.initialize
(skillExecutors:). Same probe-chain selection as EngineRegistry /
EmbeddingRegistry: the registered executor with the highest
SkillExecutorProvider.priority whose SkillExecutorProvider.canExecute
returns true for a skill type wins (first-registered breaks ties). There is
no central type map — the opt-in flutter_gemma_agent executors self-select.
Filters stop tokens from model response stream.
For .litertlm on iOS, MediaPipe doesn't handle <end_of_turn> —
this filter detects and terminates the stream at the stop token,
with buffering for partial tag matches.
Specification for a TTS model — a SELECTABLE bundle. ttsModelType carries
the model family so one generic backend dispatches to the right runtime
profile; sources is one entry per file in that type's manifest.
Policy for what happens to a previously-installed model when a new one is
set active. Lives with the spec value types (it's a per-spec install policy);
re-exported from model_file_manager_interface.dart for backward compat.
Speech-to-text model families supported by the pluggable STT backends.
Only moonshine has a shipped SttModelProfile/pipeline
(flutter_gemma_speech); the others are follow-ons that need a log-mel
frontend.
Text-to-speech model families supported by the pluggable TTS backends.
Only matcha has a shipped TtsModelProfile/pipeline (flutter_gemma_speech);
kokoro/supertonic are documented follow-ons (fail-loud until wired).
Mixin for sessions that surface the SDK's structured raw JSON response
(LiteRT-LM Gemma 4 path with tool_calls). Allows InferenceChat to read
the structured tool calls without a hard dependency on a concrete session
type, and lets non-FFI sessions opt out by simply not implementing this
mixin.