AGENTIC CHUNKER
Installation
pip install agentic-chunker
Usage
from agentic_chunker import AgenticChunker
import markdown
import os
file_path = "test_files/pronoun_dep.md"
api_key = os.environ.get('OPENAI_APIKEY')
with open(file_path, 'r', encoding='utf-8') as f:
md_content = f.read()
text = markdown.markdown(md_content)
chunker = AgenticChunker(api_key=api_key, model="gpt-4o-mini")
chunks = chunker.agentic_chunking(text, '.')
from agentic_chunker import AgenticChunker
from langchain.text_splitter import CharacterTextSplitter
import markdown
import os
file_path = "test_files/pronoun_dep.md"
api_key = os.environ.get('OPENAI_APIKEY')
with open(file_path, 'r', encoding='utf-8') as f:
md_content = f.read()
text = markdown.markdown(md_content)
chunker = AgenticChunker(api_key=api_key, model="gpt-4o-mini")
text_splitter = CharacterTextSplitter(
separator="\n",
chunk_size=100,
chunk_overlap=20
)
chunks = text_splitter.create_documents([text])
new_chunks = chunker.rechunk_langchain_chunks(chunks)
Dependencies
- openai
Contributing
Contributions to AgenticChunker are welcome! Please make sure to follow the code style and conventions used in the project. If you have any suggestions or improvements, feel free to open an issue or submit a pull request.
License
This project is licensed under the GPL-3.0 License.
Release files for agentic-chunker 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| agentic_chunker-0.0.6.tar.gz | 15.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| agentic_chunker-0.0.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 32.3 kB
Release files / agentic_chunker-0.0.6.tar.gz
| Download URL | agentic_chunker-0.0.6.tar.gz |
|---|---|
| Size | 15.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8eb84a13d56ec7c2fc263a077bb39beba91b71a89dcbf22206299c971b4bff45
|
|
BLAKE2b-256 checksum How to use checksums |
bd9fd70ca2e64f5c1aa9059c25b3011e2e1d4fcec4ffeb2eddee1604aec46718
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.6
|
Release files / agentic_chunker-0.0.6-py3-none-any.whl
| Download URL | agentic_chunker-0.0.6-py3-none-any.whl |
|---|---|
| Size | 16.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
838c645164fc27cbc5e28e242748de0d62d121911be6883f795e541511b62725
|
|
BLAKE2b-256 checksum How to use checksums |
67baf46124920a004bd2ca52f237114fd8ddd3a1fdbea1ee20c55036208df2f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.6
|