diff --git a/poetry.lock b/poetry.lock index 2a5ed9080..fb818e665 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.2.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.1.3 and should not be changed by hand. [[package]] name = "absl-py" @@ -3163,8 +3163,8 @@ markers = {main = "extra == \"mem-reader\" or extra == \"all\" or extra == \"pre [package.dependencies] numpy = [ - {version = ">=1.22.4", markers = "python_version < \"3.11\""}, {version = ">=1.23.2", markers = "python_version == \"3.11\""}, + {version = ">=1.22.4", markers = "python_version < \"3.11\""}, {version = ">=1.26.0", markers = "python_version >= \"3.12\""}, ] python-dateutil = ">=2.8.2" @@ -4018,8 +4018,8 @@ markers = {main = "extra == \"all\""} grpcio = ">=1.41.0" httpx = {version = ">=0.20.0", extras = ["http2"]} numpy = [ - {version = ">=1.21,<2.3.0", markers = "python_version == \"3.10\""}, {version = ">=1.21", markers = "python_version == \"3.11\""}, + {version = ">=1.21,<2.3.0", markers = "python_version == \"3.10\""}, {version = ">=1.26", markers = "python_version == \"3.12\""}, {version = ">=2.1.0", markers = "python_version == \"3.13\""}, {version = ">=2.3.0", markers = "python_version >= \"3.14\""}, diff --git a/src/memos/chunkers/sentence_chunker.py b/src/memos/chunkers/sentence_chunker.py index 4757301c7..f39dfb8e2 100644 --- a/src/memos/chunkers/sentence_chunker.py +++ b/src/memos/chunkers/sentence_chunker.py @@ -20,7 +20,7 @@ def __init__(self, config: SentenceChunkerConfig): from chonkie import SentenceChunker as ChonkieSentenceChunker self.config = config - + # Try new API first (v1.4.0+) try: self.chunker = ChonkieSentenceChunker( @@ -38,7 +38,7 @@ def __init__(self, config: SentenceChunkerConfig): chunk_overlap=config.chunk_overlap, min_sentences_per_chunk=config.min_sentences_per_chunk, ) - + logger.info(f"Initialized SentenceChunker with config: {config}") def chunk(self, text: str) -> list[str] | list[Chunk]: diff --git a/tests/vec_dbs/test_qdrant.py b/tests/vec_dbs/test_qdrant.py index f4bd276c3..67f76d463 100644 --- a/tests/vec_dbs/test_qdrant.py +++ b/tests/vec_dbs/test_qdrant.py @@ -70,13 +70,25 @@ def test_add_and_get_by_id(vec_db): def test_search(vec_db): id = str(uuid.uuid4()) - vec_db.client.search.return_value = [ - type( - "obj", - (object,), - {"id": id, "vector": [0.1, 0.2, 0.3], "payload": {"tag": "search"}, "score": 0.9}, - ) - ] + mock_response = type( + "QueryResponse", + (object,), + { + "points": [ + type( + "obj", + (object,), + { + "id": id, + "vector": [0.1, 0.2, 0.3], + "payload": {"tag": "search"}, + "score": 0.9, + }, + ) + ] + }, + )() + vec_db.client.query_points.return_value = mock_response results = vec_db.search([0.1, 0.2, 0.3], top_k=1) assert len(results) == 1 assert isinstance(results[0], VecDBItem)