Skip to content

Graph-Native Infrastructure for Context and Accountable AI Systems

fix: use 'is not None' for triplet cache hit check to handle empty list results

KaifAhmad1d932cb1e5b33
diff --git a/semantica/semantic_extract/methods.py b/semantica/semantic_extract/methods.py
index e0858c7e..cc8830ee 100644
--- a/semantica/semantic_extract/methods.py
+++ b/semantica/semantic_extract/methods.py
@@ -2365,7 +2365,7 @@ def extract_triplets_llm(
"relations_hash": hash(tuple(sorted([str(r) for r in relations]))) if relations else 0
}
cached_result = _result_cache.get("triplets", text, **cache_params)
- if cached_result:
+ if cached_result is not None:
logger.debug(f"Cache hit for triplet extraction ({len(cached_result)} triplets)")
return cached_result