Docs /Templates/ sinapsis-generic-data-tools

ContextChunker

sinapsis-generic-data-toolscommunity

Python template · sinapsis_generic_data_tools.templates.context_chunker

Overview

Template to chunk a list of sentences keeping a context window Attributes: window_size (int): Total sentences per chunk overlap (int): Sentences to carry over to the next chunk override_text (bool): Whether to override the text packets in the container

Capabilities

Capabilities: not set

Installation

Install the published package using pip or uv.

Terminalbash
pip install sinapsis-generic-data-tools==1.0.0
uv pip install sinapsis-generic-data-tools==1.0.0
uv add sinapsis-generic-data-tools==1.0.0

Configuration

Effective fields from the inspector schema, including nested Pydantic model fields.

overlap
int
Optional
Default: 2
metadata

Field used to set the template instance name and agent name. Defaults to None.

sinapsis_core.template_base.base_models.TemplateMetadata | None
Optional
Default: null
window_size
int
Optional
Default: 5
override_text
bool
Optional
Default: false

Configuration example

Generated from documented defaults. Replace any placeholders and complete required nested settings before running.

yaml
templates:
  - template_name: "ContextChunker"
    class_name: "ContextChunker"
    attributes:
      overlap: 2
      window_size: 5
      override_text: false

Inheritance

Immediate parent: sinapsis_core.template_base.template.Template

Environment variables

Environment definitions belong to their canonical Python modules.

No directly related environment variables listed.