fix: update deprecated APIs for chonkie v1.4.0 and qdrant-client v1.16.0#705
Conversation
d4b44a9 to
f1bc7b5
Compare
fridayL
left a comment
There was a problem hiding this comment.
need add some version compatibility code
and I will merge this pr
There was a problem hiding this comment.
I think can not make direct changes package version , because our production environment uses chonkie >=1.0.7 and chonkie <1.4.0 versions. Changing the code and version requirements means the old environment will break , causing production system errors.
My suggestion is to add some version compatibility , check the chonkie version first and then add appropriate parameters.
Although this makes the code redundant, the system needs a transitional version.
我觉得这里不可以直接进行更改,因为我们内部的线上环境是使用的chonkie >=1.0.7 and chonkie <1.4.0版本,代码以及版本更改意味着老的环境会立即失效导致线上系统报错
我的建议是做一些版本兼容,或者判断一下版本然后传参数,虽然这样代码很冗余,但系统需要有个过渡版本
There was a problem hiding this comment.
Modified as suggested with try-except for version compatibility:
Try new API (v1.4.0+) first, fallback to legacy API on failure
Reverted pyproject.toml chonkie version to >=1.0.7,<2.0.0 for production compatibility
Code pushed, please review 🙏
2b2cb30 to
b5411af
Compare

🔧 Changes
This PR addresses breaking changes and deprecations from upstream dependencies:
1. Chonkie API Update (v1.4.0)
tokenizer_or_token_counterparametertokenizer_or_token_counter→tokenizerinSentenceChunkersrc/memos/chunkers/sentence_chunker.py2. Qdrant Client API Update (v1.16.0)
search()method removed in qdrant-client v1.16.0 (feat: Reset an user's memory (quicker approach to delete all memories) #1103)client.search()withclient.query_points().pointssrc/memos/vec_dbs/qdrant.py3. Python Datetime Deprecation
datetime.utcnow()deprecated in Python 3.12+datetime.now(timezone.utc)src/memos/mem_os/core.py4. Dependency Version Updates
chonkie:>=1.0.7→>=1.4.0qdrant-client:>=1.14.2→>=1.16.0✅ Testing
📚 References