Skip to main content



Sinapsis Langchain Splitters

Templates for easy integration of LangChain text splitters with Sinapsis.

🐍 Installation • 🚀 Features • 📚 Usage example • 📙 Documentation • 🔍 License

The sinapsis-langchain-splitters module adds support for all the text splitters supported by LangChain

🐍 Installation

Install using your package manager of choice. We encourage the use of uv

Example with uv:

  uv pip install sinapsis-langchain-splitters --extra-index-url https://pypi.sinapsis.tech

or with raw pip:

  pip install sinapsis-langchain-splitters --extra-index-url https://pypi.sinapsis.tech
  uv pip install sinapsis-langchain-readers[all] --extra-index-url https://pypi.sinapsis.tech

🚀 Features

Templates Supported

The Sinapsis Langchain module provides wrapper templates for Langchain's community data loaders, making them seamlessly usable within Sinapsis.

For example, for WikipediaLoaderWrapper use sinapsis info --example-template-config WikipediaLoaderWrapper to produce the following example config:

agent:
  name: my_test_agent
  description: Agent to split text using the RecursiveCharacterTextSplitter class from LangChain
templates:
- template_name: InputTemplate
  class_name: InputTemplate
  attributes: {}
- template_name: RecursiveCharacterTextSplitterWrapper
  class_name: RecursiveCharacterTextSplitterWrapper
  template_input: InputTemplate
  attributes:
    add_document_as_text_packet: false
    generic_key: WikipediaLoaderWrapper
    recursivecharactertextsplitter_init:
      separators: [" "]
      keep_separator: true
      is_separator_regex: false

A complete list of available document loader classes in LangChain can be found at: LangChain Text Splitters

📚 Usage example

The following example demonstrates how to use the RecursiveCharacterTextSplitterWrapper template to chunk the Documents from a WikipediaLoaderWrapper template.

configuration
agent:
  name: my_test_agent
  description: "Wikipedia loader example"

templates:

- template_name: InputTemplate
  class_name: InputTemplate
  attributes: {}

- template_name: WikipediaLoaderWrapper
  class_name: WikipediaLoaderWrapper
  template_input: InputTemplate
  attributes:
    add_document_as_text_packet: false
    wikipedialoader_init:
      query: GenAI
      lang: en
      load_max_docs: 1
      load_all_available_meta: false
      doc_content_chars_max: 4000
- template_name: InputTemplate
  class_name: WikipediaLoaderWrapper
  attributes: {}
- template_name: RecursiveCharacterTextSplitterWrapper
  class_name: RecursiveCharacterTextSplitterWrapper
  template_input: InputTemplate
  attributes:
    add_document_as_text_packet: false
    generic_key: WikipediaLoaderWrapper
    recursivecharactertextsplitter_init:
      separators: null
      keep_separator: true
      is_separator_regex: false

To run, simply use:

sinapsis run name_of_the_config.yml

📙 Documentation

Documentation for this and other sinapsis packages is available on the sinapsis website

Tutorials for different projects within sinapsis are available at sinapsis tutorials page

🔍 License

This project is licensed under the AGPLv3 license, which encourages open collaboration and sharing. For more details, please refer to the LICENSE file.

For commercial use, please refer to our official Sinapsis website for information on obtaining a commercial license.

Metadata

Release files for sinapsis_langchain_splitters 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sinapsis_langchain_splitters 0.1.8
File Size Uploaded Provenance Actions
sinapsis_langchain_splitters-0.1.8.tar.gz 9.2 kB Without provenance Details for sinapsis_langchain_splitters-0.1.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sinapsis_langchain_splitters 0.1.8
File Interpreter ABI Platform Actions
sinapsis_langchain_splitters-0.1.8-py3-none-any.whl Python 3 none any Details for sinapsis_langchain_splitters-0.1.8-py3-none-any.whl

Total release size: 18.7 kB

Release files / sinapsis_langchain_splitters-0.1.8.tar.gz

Download URL sinapsis_langchain_splitters-0.1.8.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5f68d2fedff90f9806e5fec463c8950d7b074b1e622e78adc6cf7e0b5ad1534f
BLAKE2b-256 checksum
How to use checksums
3e32f0ba27b4022521d763298c65bd80dc1eaa20ad15a29c4c297750cd45c881
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.17

Release files / sinapsis_langchain_splitters-0.1.8-py3-none-any.whl

Download URL sinapsis_langchain_splitters-0.1.8-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d21c3c4ab6b034ae3221d803ba8cddd8c98713cd395c3da362341a994a669f65
BLAKE2b-256 checksum
How to use checksums
9980f2de635d292de35891989747a0fbccbcd9ddd32e746426ee8e5b66a32427
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.17

Security for sinapsis_langchain_splitters 0.1.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page