Spaces:
Runtime error
Runtime error
File size: 1,460 Bytes
6985a83 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | # File Objective : Verify the Qdrant collection was populated correctly.
# Scope : Phase 2 pass/fail gate β run after scripts/ingest.py.
# What it does : 1. Prints total point count. 2. Shows one sample chunk payload.
# What it does not: 1. Run search (Phase 3). 2. Modify anything.
from __future__ import annotations
import sys
from qdrant_client import QdrantClient
from vantage_core.config import get_settings
from vantage_core.constants import QDRANT_COLLECTION_NAME
def main() -> None:
s = get_settings()
client = QdrantClient(url=s.qdrant_url, api_key=s.qdrant_api_key, timeout=15)
count = client.count(QDRANT_COLLECTION_NAME).count
print(f"\nββ Vantage Peek ββββββββββββββββββββββββββββββββββββββββββββ")
print(f" collection : {QDRANT_COLLECTION_NAME}")
print(f" total pts : {count}")
if count == 0:
print(" β οΈ Empty β run scripts/ingest.py first.")
sys.exit(1)
results, _ = client.scroll(
QDRANT_COLLECTION_NAME, limit=1, with_payload=True, with_vectors=False
)
if results:
p = results[0]
print(f"\n Sample chunk (id={p.id}):")
for key in ("chunk_id", "category", "title", "chunk_text"):
print(f" {key:<12}: {str((p.payload or {}).get(key, 'β'))[:100]}")
print()
if __name__ == "__main__":
main()
|