Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/memos/chunkers/sentence_chunker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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]:
Expand Down
26 changes: 19 additions & 7 deletions tests/vec_dbs/test_qdrant.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down