Docs /Templates/ sinapsis-generic-data-tools

SourceHistoryAggregator

sinapsis-generic-data-toolscommunityaggregatorhistoryqueue

Python template · sinapsis_generic_data_tools.templates.source_history_aggregator

Overview

Template to store story or content of packets in the generic_field as a deque. The number of inputs in the queue is set through the attributes in the template.

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.

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
context_max_length
int
Optional
Default: 5
packet_to_extract_from
typing.Literal['audios', 'images', 'texts', 'generic_data', 'time_series', 'binary_data']
Optional
Default: "texts"

Configuration example

Example from the Python docstring:

yaml
agent:
  name: my_test_agent
templates:
- template_name: InputTemplate
  class_name: InputTemplate
  attributes: {}
- template_name: SourceHistoryAggregator
  class_name: SourceHistoryAggregator
  template_input: InputTemplate
  attributes:
        packet_to_extract_from: texts
        context_max_length: 5
Show schema-based configuration skeleton
yaml
templates:
  - template_name: "SourceHistoryAggregator"
    class_name: "SourceHistoryAggregator"
    attributes:
      context_max_length: 5
      packet_to_extract_from: "texts"

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.