Spaces:
Running
Running
| 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) | |
| result = supabase.table('query_cache').select('question, response_text, language').limit(10).execute() | |
| print("--- CACHE CONTENT ---") | |
| if not result.data: | |
| print("Cache is empty.") | |
| for row in result.data: | |
| print(f"Q: {row['question']} | Lang: {row['language']}") | |
| print(f"A: {row['response_text'][:100]}...") | |
| print("-" * 20) | |
| if __name__ == "__main__": | |
| main() | |