def get_node_similarity(entry: Dict, similarity_key: str = "score") -> float:
    """Get converted node similarity from distance."""
    score = getattr(entry["metadata"], similarity_key)

    if score is None:
        return 0.0

    # The hybrid search in Weaviate returns similarity score: https://weaviate.io/developers/weaviate/search/hybrid#explain-the-search-results
    return float(score)
Get converted node similarity from distance.
llama-index-integrations/vector_stores/llama-index-vector-stores-weaviate/llama_index/vector_stores/weaviate/utils.py