Skip to content

Commit d37305b

Browse files
Post-merge cleanup: remove dead DartBridgeRAG references in runanywhere.dart
The #462 merge re-introduced inline RAG wrapper methods in runanywhere.dart that call DartBridgeRAG.shared.* (from the old RAG implementation). These classes no longer exist on main — RAG was refactored into the RunAnywhereRAG extension in lib/public/extensions/runanywhere_rag.dart (async variants with event publishing). Deleted the orphaned inline wrappers; downstream consumers should call the extension methods directly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f0f1a90 commit d37305b

1 file changed

Lines changed: 3 additions & 68 deletions

File tree

sdk/runanywhere-flutter/packages/runanywhere/lib/public/runanywhere.dart

Lines changed: 3 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -2677,72 +2677,7 @@ class RunAnywhere {
26772677
return null;
26782678
}
26792679

2680-
// ============================================================================
2681-
// MARK: - RAG (Retrieval-Augmented Generation)
2682-
//
2683-
// Note: Additional RAG methods are also available via the RunAnywhereRAG
2684-
// extension in lib/public/extensions/runanywhere_rag.dart (async variants
2685-
// with event publishing). The inline methods below are the simpler static
2686-
// entry points from main.
2687-
// ============================================================================
2688-
2689-
/// Create a RAG pipeline with the given configuration.
2690-
///
2691-
/// Auto-registers the RAG module if needed — no explicit RAGModule.register()
2692-
/// required. The C++ bridge handles model path resolution (GGUF directory
2693-
/// scanning, vocab.txt discovery).
2694-
static Future<void> ragCreatePipeline(RAGConfiguration config) async {
2695-
if (!_isInitialized) throw SDKError.notInitialized();
2696-
DartBridgeRAG.shared.createPipeline(config);
2697-
}
2698-
2699-
/// Destroy the RAG pipeline and release resources.
2700-
static Future<void> ragDestroyPipeline() async {
2701-
DartBridgeRAG.shared.destroyPipeline();
2702-
}
2703-
2704-
/// Ingest a document into the RAG pipeline.
2705-
///
2706-
/// The document is split into chunks, embedded, and indexed.
2707-
static Future<void> ragIngest(String text, {String? metadataJson}) async {
2708-
if (!_isInitialized) throw SDKError.notInitialized();
2709-
DartBridgeRAG.shared.addDocument(text, metadataJson: metadataJson);
2710-
}
2711-
2712-
/// Ingest multiple documents in batch.
2713-
///
2714-
/// More efficient than calling [ragIngest] multiple times.
2715-
/// Each document map should have a 'text' key and optional 'metadataJson' key.
2716-
static Future<void> ragAddDocumentsBatch(
2717-
List<Map<String, String>> documents) async {
2718-
if (!_isInitialized) throw SDKError.notInitialized();
2719-
DartBridgeRAG.shared.addDocumentsBatch(documents);
2720-
}
2721-
2722-
/// Clear all documents from the RAG pipeline.
2723-
static Future<void> ragClearDocuments() async {
2724-
if (!_isInitialized) throw SDKError.notInitialized();
2725-
DartBridgeRAG.shared.clearDocuments();
2726-
}
2727-
2728-
/// Get the number of indexed document chunks.
2729-
static int get ragDocumentCount => DartBridgeRAG.shared.documentCount;
2730-
2731-
/// Get pipeline statistics as JSON.
2732-
static Future<RAGStatistics> ragGetStatistics() async {
2733-
if (!_isInitialized) throw SDKError.notInitialized();
2734-
return DartBridgeRAG.shared.getStatistics();
2735-
}
2736-
2737-
/// Query the RAG pipeline with a question.
2738-
///
2739-
/// Returns a [RAGResult] with the generated answer and retrieved chunks.
2740-
static Future<RAGResult> ragQuery(
2741-
String question, {
2742-
RAGQueryOptions? options,
2743-
}) async {
2744-
if (!_isInitialized) throw SDKError.notInitialized();
2745-
final queryOptions = options ?? RAGQueryOptions(question: question);
2746-
return DartBridgeRAG.shared.query(queryOptions);
2747-
}
2680+
// RAG methods are available via the RunAnywhereRAG extension in
2681+
// lib/public/extensions/runanywhere_rag.dart (async variants with event
2682+
// publishing).
27482683
}

0 commit comments

Comments
 (0)