diff --git a/nemoguardrails/kb/kb.py b/nemoguardrails/kb/kb.py index 685f8a9a0..bd440f842 100644 --- a/nemoguardrails/kb/kb.py +++ b/nemoguardrails/kb/kb.py @@ -167,6 +167,8 @@ async def build(self): # We also save the file for future use os.makedirs(CACHE_FOLDER, exist_ok=True) basic_index = cast(BasicEmbeddingsIndex, self.index) + if not basic_index.embeddings_index: + raise Exception("Couldn't create basic embeddings index") basic_index.embeddings_index.save(cache_file) # And, explicitly save the size as we need it when we reload diff --git a/pyproject.toml b/pyproject.toml index 6f841582d..8fa31661e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -157,6 +157,7 @@ pyright = "^1.1.405" include = [ "nemoguardrails/rails/**", "nemoguardrails/actions/**", + "nemoguardrails/kb/**", "nemoguardrails/logging/**", "nemoguardrails/tracing/**", "tests/test_callbacks.py",