v1.0.6
✨ Highlights
- Welcome Chonkie's very own agentic chunker,
SlumberChunker! Requires thegenieoptional install to work.Genieis Chonkie's Generative Inference Engines, that allow any generative models or API to easily plug-in with Chonkie. Currently, thegenieoptional install installs dependencies forGeminiGenie— and will require aGEMINI_API_KEYto work properly.
pip install "chonkie[genie]"# Import
from chonkie import SlumberChunker
# Initialize
chunker = SlumberChunker(verbose=True) # set verbose to True, since it takes a while~
# CHONK!
chunker(text) - A fully neural approach to chunking,
NeuralChunker! Requires theneuraloptional install to work. This uses a BERT-like model that's fine-tuned for chunking, making it really fast and high-quality. Second only toSlumberChunkerin terms of chunk quality.
pip install "chonkie[neural]"# import
from chonkie import NeuralChunker
# initialize
chunker = NeuralChunker()
# CHONK!
chunks = chunker(text) - Added
autolanguage detection forCodeChunker! Now you can just pass in code to it without having to specify the language before hand. It will detect the language by itself. While the latency for detection is minimal (sub-millisecond), it does affect performance, so please specify the language if you care.
# Import
from chonkie import CodeChunker
# Initialize the "auto" CodeChunker
chunker = CodeChunker() # No need to specify, "auto" by default
# CHONK!
chunks = chunker(code) - Added
Genies! Since this version features our first generative feature, theSlumberChunker, we added theGenieto work with it as well as future generative features.Genie's are chonkie's way to handle multiple APIs and model interfaces working together for chunking~ The firstGenieto be added is theGeminiGenie— which works withGeminimodels. Requires thegenieoptional install.
pip install "chonkie[genie]"# Import
from chonkie import GeminiGenie
# Init
genie = GeminiGenie(api_key=YOUR_API_KEY)
# generate
genie.generate("Hi!")
# generate JSON
genie.generate_json("Hi", JSON_SCHEMA) What's Changed
- Feat : update test workflow to run on prs even before merging by @not-lain in #69
- Feat: Run CI/CD on PRs as well by @chonknick in #70
- Feat: Add support for auto-detecting language in
CodeChunkerviaMagikaby @chonknick in #71 - Feat: Add initial support for
SlumberChunkerby @chonknick in #73 - Feat: Add
autolanguage support forCodeChunker+ Add initial support forSlumberChunkerby @chonknick in #74 - Update version to 1.0.6a0 in pyproject.toml and init.py for upcom… by @chonknick in #75
- Fix: Resolve pickling error in BaseTokenizer by replacing lambda by @Harsha-Karimikonda in #76
- Fix:
SlumberChunker's splitting algorithm fromRecursiveChunkerto custom + Pickling issue inBaseTokenizerby @chonknick in #78 - Feat: Add initial support for the
NeuralChunkerby @chonknick in #77 - Feat: Add support for
NeuralChunker+ Bump version tov1.0.6by @chonknick in #79 - Update README.md by @chonknick in #80
New Contributors
Full Changelog: v1.0.5...v1.0.6