Skip to content

Conversation

@mmailhos
Copy link
Owner

@mmailhos mmailhos commented Oct 4, 2025

Generated bindings for Python.

e.g.

def test_hnsw_index():
    """Test HNSWIndex functionality."""
    print("Testing HNSWIndex...")
    
    # Create vectors
    vectors = [
        vectorlite.Vector(id=0, values=[1.0, 0.0, 0.0]),
        vectorlite.Vector(id=1, values=[0.0, 1.0, 0.0]),
        vectorlite.Vector(id=2, values=[0.0, 0.0, 1.0]),
    ]
    
    # Create index
    index = vectorlite.HNSWIndexWrapper(dimension=3, vectors=vectors)
    assert len(index) == 3
    assert index.dimension() == 3
    assert not index.is_empty()
    print(f"✓ HNSWIndex creation: {index}")
    
    # Test search
    query = [1.0, 0.0, 0.0]
    results = index.search(query, k=2)
    assert len(results) == 2
    print(f"✓ HNSWIndex search: {results}")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants