cleaned code
This commit is contained in:
@@ -163,17 +163,13 @@ class BaseGraphStorage(StorageNameSpace):
|
||||
"""Get an edge by its source and target node ids."""
|
||||
|
||||
async def get_edge(
|
||||
self,
|
||||
source_node_id: str,
|
||||
target_node_id: str
|
||||
) -> dict[str, str] | None :
|
||||
self, source_node_id: str, target_node_id: str
|
||||
) -> dict[str, str] | None:
|
||||
raise NotImplementedError
|
||||
|
||||
"""Get all edges connected to a node."""
|
||||
|
||||
async def get_node_edges(
|
||||
self, source_node_id: str
|
||||
) -> list[tuple[str, str]] | None:
|
||||
async def get_node_edges(self, source_node_id: str) -> list[tuple[str, str]] | None:
|
||||
raise NotImplementedError
|
||||
|
||||
"""Upsert a node into the graph."""
|
||||
|
@@ -1,4 +1,3 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
@@ -488,7 +488,7 @@ def cosine_similarity(v1, v2):
|
||||
return dot_product / (norm1 * norm2)
|
||||
|
||||
|
||||
def quantize_embedding(embedding: np.ndarray | list[float], bits: int=8) -> tuple:
|
||||
def quantize_embedding(embedding: np.ndarray | list[float], bits: int = 8) -> tuple:
|
||||
"""Quantize embedding to specified bits"""
|
||||
# Convert list to numpy array if needed
|
||||
if isinstance(embedding, list):
|
||||
|
Reference in New Issue
Block a user