Skip to main content
Prerequisites: This page requires Python familiarity. If you are a non-technical operator, work with your developer to configure these classes.
Use these classes in your functions to manage conversation state and voice configuration.

Core class

Conversation

The primary class for managing conversation state at runtime. Every function receives a Conversation instance as its first argument.
def get_conversation_id(conv: Conversation):
    return conv.id
For full attributes and methods, see the conv object page.

Voice classes

Use voice classes to configure TTS providers programmatically — for example, in a start function or when using multi-voice.

VoiceWeighting

Assign specific weightings to voices for multi-voice setups, adjusting their prominence in a given context.
VoiceWeighting(
      voice=ElevenLabsVoice(
        provider_voice_id="LcfcDJNUP1GQjkzn1xUU",
        similarity_boost=0.2,
        stability=0.4
      ),
      weight=0.25
    )

TTS provider classes

Configures voice settings for ElevenLabs TTS, with control over stability and similarity.
elevenlabs_voice = ElevenLabsVoice(
    provider_voice_id="a1b2C3d4E5f6G7h8I9j0",
    stability=0.5,
    similarity_boost=0.7
)
ParameterDescription
provider_voice_idThe ElevenLabs voice ID
stabilityConsistency of tone and delivery (0.0–1.0)
similarity_boostHow closely the voice matches the original (0.0–1.0)
For full voice configuration examples including ElevenLabs model IDs, Cartesia emotions, and cache behavior, see the Voice class reference.
Last modified on March 22, 2026