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 License.

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.5.tar.gz (15.8 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.5-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: agentic_chunker-0.0.5.tar.gz
  • Upload date:
  • Size: 15.8 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.5.tar.gz
Algorithm Hash digest
SHA256 0c00981a1ad4ca6525c43c9163565efb28735786efba32a1d721aa3df37ddb1d
MD5 f0d9efe3dcaefea37c7b20f67f3d8886
BLAKE2b-256 921c6d89bc8f8da097e18f82f484684818c8fe4f907e71eaea6cc39cf857bdb7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for agentic_chunker-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 3146843d4610edfa555e07554ff2cafe4d834828a1a58843feca770575c53291
MD5 129b3b37cefae1a5c519449ab57b4702
BLAKE2b-256 a0eb73d70f5833b11b54f4248d84acab4714a82a581c600ccd76aeaabc53c13f

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