Skip to main content

No project description provided

Project description

AGENTIC CHUNKER

Installation

pip install agentic-chunker

Usage

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")
chunks = chunker.agentic_chunking(text, '.')
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")
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 .

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentic_chunker-0.0.4.tar.gz (15.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentic_chunker-0.0.4-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file agentic_chunker-0.0.4.tar.gz.

File metadata

  • Download URL: agentic_chunker-0.0.4.tar.gz
  • Upload date:
  • Size: 15.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.6

File hashes

Hashes for agentic_chunker-0.0.4.tar.gz
Algorithm Hash digest
SHA256 df087e6f73d6b16e8a1d3b9482a9a02ff8e132f84285ebefe28553ae6b6a3f6e
MD5 6aeb52879eae7a31538639d2f4ce7a45
BLAKE2b-256 93e079aa65c225cb5a732c7e1ced0236ce0e11eabe1cfdb2726f2caae6923a65

See more details on using hashes here.

File details

Details for the file agentic_chunker-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for agentic_chunker-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3e9dc103527134bb3c91874b4cce6ca1c5f25c165090479c5bea52daf4d693d9
MD5 59629aefe4eec3ee7c2135f889945f53
BLAKE2b-256 61aed1117d3c3a30a073adb0a211e99813bac06dbbdd49fa6a77974cfd868952

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page