File size: 434 Bytes
25fc3a2
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from chroma_db_indexer import ChromaDBIndexer

def test_chroma_db_indexer():
    chroma_db_indexer = ChromaDBIndexer()
    
    # Test creating index
    index = chroma_db_indexer.create_index()
    assert index.metric_type == "cosine"
    assert index.dim == 768
    
    # Test uploading embeddings
    embeddings = [0]*768
    chroma_db_indexer.upload_embeddings(embeddings, index)
    assert len(index.search(embeddings, 1)) == 1