RagSession class
One RAG corpus with its index.
The Flutter RAG bridge owns a single native session (matching RN/Web), so RagApi.open rejects a second concurrent session instead of silently superseding the active one. Calls after close throw.
Properties
Methods
-
clear(
) → Future< void> - Drop every document from the corpus, keeping the session open.
-
close(
) → Future< void> - Destroy the index and release native resources.
-
ingest(
RagDocument document) → Future< void> -
Index
documentinto the corpus. -
ingestAll(
List< RagDocument> documents) → Future<void> -
Index every document in
documents. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
query(
String question, {RagQueryOptions? options}) → Future< RagResult> -
Answer
questionfrom the corpus. -
queryStream(
String question, {RagQueryOptions? options}) → Stream< RagEvent> -
Answer
question, emitting retrieved chunks then answer tokens. -
search(
String query, {int? topK}) → Future< List< Match> > -
Retrieve the chunks closest to
querywithout generating an answer. -
stats(
) → Future< RagStats> - Document, chunk, and index-size counts.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited