Return total number of indexed chunks across all files.
()
| 175 | |
| 176 | |
| 177 | def count_chunks() -> int: |
| 178 | """Return total number of indexed chunks across all files.""" |
| 179 | total = 0 |
| 180 | for chunk_file in (KB_ROOT / "embeddings").glob("*.chunks.json"): |
| 181 | try: |
| 182 | with open(chunk_file) as f: |
| 183 | total += len(json.load(f)) |
| 184 | except Exception: |
| 185 | pass |
| 186 | return total |