Spaces:
Sleeping
Sleeping
File size: 1,016 Bytes
f834eaa 6399ce4 f834eaa 6399ce4 f834eaa | 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 | import os
from supabase import create_client
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from config import settings
SUPABASE_URL = settings.SUPABASE_URL
SUPABASE_KEY = settings.SUPABASE_KEY
def main():
supabase = create_client(SUPABASE_URL, SUPABASE_KEY)
print("=== CACHE AUDIT ===")
cache = supabase.table('query_cache').select('question, response_text, hit_count').limit(5).execute()
if not cache.data:
print("Cache is empty.")
else:
for row in cache.data:
print(f"Q: {row['question']} | Hits: {row['hit_count']}")
print(f"A: {row['response_text'][:50]}...")
print("\n=== DOCUMENT CHUNKS AUDIT ===")
chunks = supabase.table('document_chunks').select('scheme_title, chunk_text').limit(3).execute()
for row in chunks.data:
print(f"Scheme: {row['scheme_title']}")
print(f"Text: {row['chunk_text'][:100]}...")
print("-" * 20)
if __name__ == "__main__":
main()
|