Skip to main content

sp



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

[!IMPORTANT] The langchain readers templates may require extra dependencies. For development, we recommend installing the package with all the optional dependencies:

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

[!IMPORTANT] Some langchain templates require additional system dependencies. Please refer to the official LangChain Document Loaders documentation for additional requirements.

🚀 Features

Templates Supported

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

[!NOTE] Each loader template supports one attribute:

  • add_document_as_text_packet (bool, default: False): Whether to add the loaded document as a text packet. Other attributes can be dynamically assigned through the class initialization dictionary (class init attributes).

[!TIP] Use CLI command sinapsis info --all-template-names to show a list with all the available Template names installed with Sinapsis Langchain.

[!TIP] Use CLI command sinapsis info --example-template-config TEMPLATE_NAME to produce an example Agent config for the Template specified in TEMPLATE_NAME.

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

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.10
File Size Uploaded
sinapsis_langchain_splitters-0.1.10.tar.gz 9.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sinapsis-langchain-splitters 0.1.10
File Interpreter ABI Platform
sinapsis_langchain_splitters-0.1.10-py3-none-any.whl Python 3 none any Details

Total release size: 19.3 kB

Release files / sinapsis_langchain_splitters-0.1.10.tar.gz

Download URL sinapsis_langchain_splitters-0.1.10.tar.gz
Size 9.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e9b4c98a44c1f1ca8e2546c6f14ba641fbeaed3b80c0e3afa19576c0986e172e
BLAKE2b-256 checksum
How to use checksums
838bc8dc512ea1fea52adcf99a997292d49b8f55140bab8fc295c34c1cb73433
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.16

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

Download URL sinapsis_langchain_splitters-0.1.10-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
94438fb2ae42565b22eee353166cd1c4c64f5418128db86a90ec94a1ebc1828b
BLAKE2b-256 checksum
How to use checksums
abeb3dbb5ba39e77619f198ee7177e47c620f07161079bc43a594f5e7bed58e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.16

Release history Release notifications | RSS feed

This release

0.1.10 This release

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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