GemmaRag class
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).
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addDocument(
{required String id, required String content, String? metadata}) → Future< void> - Add a document; its embedding is computed automatically (needs an active embedding model).
-
addDocumentWithEmbedding(
{required String id, required String content, required List< double> embedding, String? metadata}) → Future<void> - Add a document with a precomputed embedding.
-
clear(
) → Future< void> - Remove all documents from the vector store.
-
initialize(
String databasePath) → Future< void> - Initialize the vector store database.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeDocument(
{required String id}) → Future< void> - Remove a single document by ID. No-op if the ID is absent.
-
searchSimilar(
{required String query, int topK = 5, double threshold = 0.0, Filter? filter}) → Future< List< RetrievalResult> > -
Search for similar documents.
filterconstrains by declared payload fields (see FlutterGemmaPlugin.searchSimilar). -
stats(
) → Future< VectorStoreStats> - Vector store statistics.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited