m
hi
t
Thanks for reaching out, Rahib. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'd love to help you out! Could you please share a bit more about your question or the issue you're facing? That way, I can make sure to assist you in the best possible way.
m
How do i integrate elevenlabs prompt guidelines when using TTS ? Or does livekit Agent instructions is enough to support the elevenlabs instructions ? Or is there a different way to do it ?
t
Thank you for reaching out! I understand that the LiveKit agent instructions might feel a bit limited when it comes to directly applying ElevenLabs prompt guidelines, since those instructions mainly guide the LLM behavior rather than the TTS engine itself. But don’t worry—we have a great way to integrate ElevenLabs TTS smoothly using the LiveKit plugin designed specifically for ElevenLabs. This plugin offers handy features like voice settings and SSML tags to help you customize your experience. Here’s a simple path you can follow: 1. Install the Plugin: Just use your preferred package manager to add the ElevenLabs plugin for LiveKit. 2. Set Up Authentication: Pop your ElevenLabs API key into a
.env
file to get things connected. 3. Configure TTS: You can tailor voice characteristics like
voice_id
,
model
, and
voice_settings
to adjust stability, style, and speed exactly how you want. 4. Use SSML: Don’t forget to enable SSML parsing! It’s great for controlling pronunciation and pacing with tags like
<phoneme>
and
<break>
. Just a quick heads-up: ElevenLabs-specific prompt markers like
[laughing]
or
[smiling]
aren’t directly supported. However, you can still create similar effects by fine-tuning voice settings or by pre-processing the LLM output to include SSML or adjusted parameters. If you’d like, I’m here to help with detailed examples or any other questions you might have—just let me know! Sources: pipeline-tts/elevenlabs_tts.py | ElevenLabs TTS integration guide | LiveKit Docs | ElevenLabs integration guide | LiveKit Docs | ElevenLabs TTS integration guide | LiveKit Docs
m
can you give me an example on how to use SSML setting and update instructions.
t
Here’s a friendly example to help you use SSML settings with ElevenLabs TTS in LiveKit: 1. Enable SSML Parsing: First, make sure SSML parsing is turned on in your TTS configuration by setting
enable_ssml_parsing=True
. This step is key to getting everything to work smoothly. 2. Example of SSML Input:
Copy code
<speak>
  The word "GIF" is pronounced <phoneme alphabet="ipa" ph="dʒɪf">JIF</phoneme>.
  <break time="500ms"/> This is an example of a pause.
</speak>
3. Python Code Example:
Copy code
from livekit.plugins import elevenlabs

tts_instance = elevenlabs.TTS(
    voice_id="ODq5zmih8GrVes37Dizd",
    model="eleven_multilingual_v2",
    voice_settings=elevenlabs.VoiceSettings(
        stability=0.7,
        similarity_boost=0.85,
        style=0.5,
        speed=1.0,
        use_speaker_boost=True
    ),
    language="en",
    enable_ssml_parsing=True
)

# Example text with SSML
tts_instance.speak("<speak>Hello, <break time='1s'/> how are you?</speak>")
This little example shows how you can use SSML tags like
<phoneme>
to guide pronunciation and
<break>
to add pauses. Feel free to include these tags in your text input to make the speech sound just right. If anything feels unclear or if you'd like me to walk you through more examples, just let me know—I’m here to help!
m
So how are prompts different from instructions in livekit Agents? How do i set prompts then ? And what are some of the best practices for creating instructions? Like can i add tone and all those things in there? Or if i want to do that I should do it differently?
t
I’m happy to walk you through the differences between prompts and instructions in LiveKit Agents, how to set them up, and some friendly tips for creating effective instructions: Difference Between Prompts and Instructions • Instructions: These shape the agent's behavior, tone, and role throughout the conversation. Think of them as the agent’s personality guide. For example, "You are a friendly and empathetic customer support agent." • Prompts: When it comes to TTS (Text-to-Speech), prompts (found in the
instructions
field) help control how the speech sounds—things like tone, pace, and style. For example, "Speak in a calm and engaging tone." How to Set Instructions 1. For the Agent (LLM Context): You can provide
instructions
when you initialize the agent or update them on the fly using
await agent.update_instructions("New instructions")
. It’s pretty straightforward! 2. For TTS (Speech Style): Just set the
instructions
in your TTS configuration to guide how the speech is delivered. For example:
Copy code
from livekit.plugins import google

tts = google.beta.GeminiTTS(
    instructions="Speak in a friendly and engaging tone."
)
Best Practices for Creating Instructions • Define Identity and Role: Clearly explain who the agent is and what they’re here to do. • Specify Tone and Personality: Use warm and descriptive words like "friendly," "empathetic," or "professional." • Include Context: Let the agent know the setting, for example, "This is a live, spoken dialogue over the phone." • Use Natural Language: Encourage a conversational flow with natural pacing and emotional pauses. • Set Operational Guidelines: Add helpful rules for tricky situations, like "Always confirm changes clearly." • Focus TTS Prompts on Audio Style: Remember, prompts should shape how things sound, not what is said. Just a quick note: while tone and emotions can be added to TTS prompts using voice settings or SSML tags, they don’t impact the LLM’s reasoning. If you’d like more examples or need any clarification, please don’t hesitate to ask—I’m here to help! Sources: agents/src/voice/generation.ts | Google integration guide | LiveKit Docs | Docs::Agents | livekit-agents/livekit/agents/voice/agent.py | Gemini TTS integration guide | LiveKit Docs
m
so this only works with the google gemini and not elevenlabs right ?
tts = google.beta.GeminiTTS(
instructions="Speak in a friendly and engaging tone."
)
t
Thanks for reaching out! I’d love to help clarify how ElevenLabs TTS works when integrated with LiveKit. Unlike Google Gemini TTS, ElevenLabs doesn’t support natural language instructions for tone and style. Instead, you can fine-tune voice characteristics using numeric and boolean parameters within
voice_settings
, such as: • stability: Controls emotional stability (0.0–1.0). • similarity_boost: Enhances similarity to the original voice (0.0–1.0). • style: Influences expressiveness (0.0–1.0). • speed: Adjusts narration speed (0.8–1.2). • use_speaker_boost: Improves voice clarity (boolean). These settings give you some great ways to customize the voice, though they don’t accept natural language prompts like "Speak in a friendly and engaging tone." ElevenLabs also supports SSML parsing for pronunciation tweaks, but keep in mind this mainly helps with phonetics rather than tone or emotional delivery. On the other hand, Google Gemini TTS does allow you to include an
instructions
parameter where you can simply describe the tone, style, and pace you want. For example:
Copy code
tts = google.beta.GeminiTTS(
  model="gemini-2.5-flash-preview-tts",
  voice_name="Zephyr",
  instructions="Speak in a friendly and engaging tone."
)
If you’d like, I’m here to guide you through setting up either ElevenLabs or Gemini TTS configurations—just let me know how I can assist! Sources: plugins/elevenlabs/src/tts.ts | Docs::Agents | livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/tts.p... | Docs::Agents