File size: 1,086 Bytes
3491bae
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import os
import json
from supabase import create_client
from dotenv import load_dotenv

load_dotenv()
url = os.getenv('SUPABASE_URL')
key = os.getenv('SUPABASE_KEY')

supabase = create_client(url, key)
chats = supabase.table('chats').select('id, topics_json').order('id', desc=True).limit(5).execute().data

for chat in chats:
    tj = chat.get('topics_json')
    if isinstance(tj, dict) and 'aacsb_audit' in tj:
        audit = tj['aacsb_audit']
        print(f"Chat ID: {chat['id']}, Total Papers Evaluated: {len(audit['papers'])}")
        scores = [p['score'] for p in audit['papers']]
        categories = [p['final_category'] for p in audit['papers']]
        print(f"Scores: {scores}")
        print(f"Categories: {categories}")
        print(f"Verbatim for first few NONEs:")
        none_count = 0
        for p in audit['papers']:
            if p['final_category'] == 'NONE':
                print(f" - {p['verbatim_evidence']}")
                none_count += 1
                if none_count > 3: break
        break
else:
    print('No aacsb_audit found in recent chats.')