addDocuments method
- List<
AIDocument> docs
override
Adds documents to the store. Implementation should compute embeddings if the document doesn't have them yet.
Implementation
@override
Future<void> addDocuments(List<AIDocument> docs) async {
for (final doc in docs) {
if (doc.embedding == null) {
doc.embedding = await embedder.embed(doc.content);
}
_documents.add(doc);
}
}