Docs /Templates/ sinapsis-elevenlabs

ElevenLabsVoiceGeneration

sinapsis-elevenlabsElevenlabsaudioelevenlabsspeechtext_to_speech

Python template · sinapsis_elevenlabs.templates.elevenlabs_voice_generation

Overview

Template to generate a voice using ElevenLabs API.

The template takes the voice description as an attribute and the prompt for the audio as a TextPacket stored in the DataContainer and stores the generated audio in the DataContainer.

Capabilities

Capabilities: not set

Installation

Install the published package using pip or uv.

Terminalbash
pip install sinapsis-elevenlabs==1.0.0
uv pip install sinapsis-elevenlabs==1.0.0
uv add sinapsis-elevenlabs==1.0.0

Configuration

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

model
typing.Literal['eleven_turbo_v2_5', 'eleven_multilingual_v2', 'eleven_turbo_v2', 'eleven_monolingual_v1', 'eleven_multilingual_v1', 'eleven_english_sts_v2', 'eleven_multilingual_sts_v2']
Optional
Default: "eleven_turbo_v2_5"
voice
str | elevenlabs.types.voice.Voice | None
Optional
Default: null
stream
bool
Optional
Default: false
api_key
str | None
Optional
Default: null
metadata
sinapsis_core.template_base.base_models.TemplateMetadata | None
Optional
Default: null
output_format
typing.Union[typing.Literal['mp3_22050_32', 'mp3_44100_32', 'mp3_44100_64', 'mp3_44100_96', 'mp3_44100_128', 'mp3_44100_192', 'pcm_16000', 'pcm_22050', 'pcm_24000', 'pcm_44100', 'ulaw_8000'], typing.Any]
Optional
Default: "mp3_44100_128"
voice_settings
VoiceSettings
Optional
Default: null
speed
typing.Optional[float]
Optional
Default: null
style
typing.Optional[float]
Optional
Default: null
stability
typing.Optional[float]
Optional
Default: null
clone_strength
typing.Optional[float]
Optional
Default: null
similarity_boost
typing.Optional[float]
Optional
Default: null
use_speaker_boost
typing.Optional[bool]
Optional
Default: null
voice_descriptionRequired

A description of the voice to be used for synthesis.

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: ElevenLabsVoiceGeneration
  class_name: ElevenLabsVoiceGeneration
  template_input: InputTemplate
  attributes:
    voice: null
    voice_settings: null
    model: eleven_turbo_v2_5
    output_format: mp3_44100_128
    stream: false
    voice_description: An old British male with a raspy, deep voice. Professional,
      relaxed and assertive
Show schema-based configuration skeleton
yaml
templates:
  - template_name: "ElevenLabsVoiceGeneration"
    class_name: "ElevenLabsVoiceGeneration"
    attributes:
      model: "eleven_turbo_v2_5"
      voice: null
      stream: false
      api_key: null
      output_format: "mp3_44100_128"
      voice_settings:
        speed: null
        style: null
        stability: null
        clone_strength: null
        similarity_boost: null
        use_speaker_boost: null
      voice_description: "<required>"

Inheritance

Immediate parent: sinapsis_elevenlabs.templates.elevenlabs_base.ElevenLabsBase

Environment variables

Environment definitions belong to their canonical Python modules.

No directly related environment variables listed.