MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / _blob_to_vector

Function _blob_to_vector

skills/wiki-store/scripts/wiki_db.py:111–120  ·  view source on GitHub ↗
(blob: Any)

Source from the content-addressed store, hash-verified

109
110
111def _blob_to_vector(blob: Any) -> np.ndarray:
112 if blob is None:
113 return np.array([], dtype=np.float32)
114 if isinstance(blob, memoryview):
115 blob = blob.tobytes()
116 array = np.frombuffer(blob, dtype=np.float32)
117 norm = float(np.linalg.norm(array))
118 if norm > 0:
119 array = array / norm
120 return array
121
122
123def _node_embedding_text(node: Dict[str, Any]) -> str:

Callers 1

vector_search_nodesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected