hasTopicEmbeddings method

bool hasTopicEmbeddings(
  1. String topicId
)

Check whether a topic's chunks have embeddings locally.

Implementation

bool hasTopicEmbeddings(String topicId) {
  if (_db == null) return false;
  final result = _db!.select(
    'SELECT COUNT(*) as cnt FROM local_chunks WHERE topic_id = ? AND embedding IS NOT NULL',
    [topicId],
  );
  return (result.first['cnt'] as int) > 0;
}