The PolyAI platform supports flexible voice selection for external providers such as ElevenLabs, AWS Polly, and Microsoft Azure TTS.

Provider classes

When picking models, adjusting stability, or accessing third-party providers — use provider-specific TTSVoice classes:

Example: ElevenLabs

from polyai.voice import ElevenLabsVoice

conv.set_voice(
    ElevenLabsVoice(
        provider_voice_id="gDnGxUcsitTxRiGHr904",
        model_id="eleven_flash_v2",
        stability=0.5,
        similarity_boost=0.7,
    )
)

Example: AWS Polly

from polyai.voice import PollyVoice

conv.set_voice(
    PollyVoice(
        provider_voice_id="Joanna",
        engine="neural",
    )
)

Example: Microsoft Azure TTS

from polyai.voice import AzureVoice

conv.set_voice(
    AzureVoice(
        provider_voice_id="en-US-JennyNeural",
        style="cheerful",
        role="customer-service-rep"
    )
)

Cache behavior

  • Changing model_id does not automatically invalidate cached audio.
  • To reset cached audio:
    • Go to Audio > Cache and delete existing entries.
    • Or, create a new voice entry with a different voice_id.
    • You can prepend model ID to voice ID (e.g. eleven_flash_v2/a1b2c3…) if you want to isolate caches across models.