Docs /Templates/ sinapsis-generic-data-tools

PacketBufferQueue

sinapsis-generic-data-toolscommunitybufferqueue

Python template · sinapsis_generic_data_tools.templates.packet_buffer_queue

Overview

Template to perform buffering of a data packet Data is stored in a front buffer unless a trigger is set in which case, a PacketBuffer is generated, and data is stored in the tail buffer. Once the tail buffer is full, it is appended to the generic_data field in DataContainer

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
sinapsis_core.template_base.base_models.TemplateMetadata | None
Optional
Default: null
tail_sizeRequired

size of the tail queue packet_to_store(Literal["audios", "images", "texts", "time_series", "binary_data"]): type of packet to be buffered.

int
Required
Default: null
front_sizeRequired

size of the front queue

int
Required
Default: null
buffer_nameRequired

name of the buffer

str
Required
Default: null
packet_to_storeRequired
typing.Literal['audios', 'images', 'texts', 'time_series', 'binary_data']
Required
Default: null

Configuration example

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

yaml
templates:
  - template_name: "PacketBufferQueue"
    class_name: "PacketBufferQueue"
    attributes:
      tail_size: "<required>"
      front_size: "<required>"
      buffer_name: "<required>"
      packet_to_store: "<required>"
View original docstring example

The source example references BufferTemplate, not PacketBufferQueue.

yaml
agent:
  name: my_test_agent
templates:
- template_name: InputTemplate
  class_name: InputTemplate
  attributes: {}
- template_name: BufferTemplate
  class_name: BufferTemplate
  template_input: InputTemplate
  attributes:
    buffer_name: 'name_of_buffer'
    front_size: '10'
    tail_size: '10'
    packet_to_store: '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.