fix: Handle empty store similarity (numpy) (#2602)

This commit is contained in:
William FH
2024-12-02 18:20:19 -08:00
committed by GitHub
parent 0361554fcf
commit 36b6cd1493
2 changed files with 3 additions and 1 deletions
@@ -413,6 +413,8 @@ def _cosine_similarity(X: list[float], Y: list[list[float]]) -> list[float]:
Compute cosine similarity between a vector X and a matrix Y.
Lazy import numpy for efficiency.
"""
if not Y:
return []
if _check_numpy():
import numpy as np # type: ignore
+1 -1
View File
@@ -1,6 +1,6 @@
[tool.poetry]
name = "langgraph-checkpoint"
version = "2.0.7"
version = "2.0.8"
description = "Library with base interfaces for LangGraph checkpoint savers."
authors = []
license = "MIT"