File size: 282 Bytes
0685af6
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
import chromadb


def get_relevant_segments(query, db_path, n_results=5):
    client = chromadb.PersistentClient(db_path)
    collection= client.get_collection('huberman_videos')
    
    results = collection.query(query_texts=[query], n_results=n_results)
    
    return results