Docs /Templates/ sinapsis-huggingface-embeddings

HuggingFaceEmbeddingExtractor

sinapsis-huggingface-embeddingsHuggingFacehuggingfaceextractormodelstext

Python template · sinapsis_huggingface_embeddings.templates.hugging_face_embedding_extractor

Overview

The template includes functionality to generate text embeddings using HuggingFace models, and adding those embeddings to the annotations field of the TextPacket

Capabilities

Capabilities: not set

Installation

Install the published package using pip or uv.

Terminalbash
pip install sinapsis-huggingface-embeddings==1.0.0
uv pip install sinapsis-huggingface-embeddings==1.0.0
uv add sinapsis-huggingface-embeddings==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
model_nameRequired

Name of the HuggingFace model for generating embeddings.

str
Required
Default: null

Configuration example

Example from the Python docstring:

yaml
agent:
  name: my_test_agent
templates:
- template_name: InputTemplate
  class_name: InputTemplate
  attributes: {}
- template_name: HuggingFaceEmbeddingExtractor
  class_name: HuggingFaceEmbeddingExtractor
  template_input: InputTemplate
  attributes:
    model_name: 'embedding_model'
Show schema-based configuration skeleton
yaml
templates:
  - template_name: "HuggingFaceEmbeddingExtractor"
    class_name: "HuggingFaceEmbeddingExtractor"
    attributes:
      model_name: "<required>"

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.