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 experiencing? That way, I can make sure to assist you in the best possible way.
m
Why is it that when i keep the system instructions less and less too call the agent feels more natural but when i integrate workflows it start sounding more robotic? What is the balance when creating voice agents when it comes to instructions and tool calls?
t
Creating a natural-sounding voice agent is all about finding the right balance between system instructions and tool calls, and I’m here to guide you through it: • System Instructions: These help shape the agent’s tone, pacing, and how the conversation flows. For example, using short, natural responses with gentle vocal pauses (like saying "Alright...") can make the interaction feel much more human and engaging. • Tool Calls: These come into play when the agent needs to perform real actions, such as updating orders, transferring you to another agent, or changing your user data. They’re key to making sure everything happens accurately behind the scenes. For example, an agent might gently infer what you want (like assuming a "large meal" includes large fries and a drink) so you don’t have to answer repetitive questions. But when you make a change to your order, the agent will use a tool call to update the system properly. By keeping the conversational flow (system instructions) separate from the actual backend actions (tool calls), you can build a voice agent that feels natural and friendly while still getting things done right. I hope this helps clarify things for you! Sources: .cursor/rules/agent-core.mdc
m
why arent the tool call async? Like why cant agent do both speak and make the tool call in the background ? at the same time. ?
t
Thank you for reaching out with your question! I’d love to help clarify why voice agents can’t perform tool calls asynchronously while speaking. It mainly comes down to some important design choices that keep everything running smoothly and reliably. Here’s a little breakdown: • Lifecycle Dependency: The results from tools need to update the conversation context, which can only happen once the speech has finished playing. This helps keep the flow clear and consistent. • Deadlock Prevention: To prevent any circular dependencies that could cause issues, the system handles speech and tool execution one after the other, rather than at the same time. • Channel Management: Since audio and text streams need to be properly closed and restarted after using a tool, it’s just not possible to do this while speech is still going on. While these constraints might feel a bit limiting, they actually help ensure that everything works accurately and predictably. I hope this explanation helps, and please feel free to ask if you’d like me to dive deeper into any part! Sources: livekit-plugins/livekit-plugins-aws/livekit/plugins/aws/experimental/realti... | DeepSeek LLM plugin guide | LiveKit Docs | Fireworks AI LLM plugin guide | LiveKit Docs | Anthropic Claude LLM plugin guide | LiveKit Docs | Groq LLM plugin guide | LiveKit Docs
m
how to have better guardrail system when in telephony agent I noticed that whenever in the middle of conveersation i start talking about something else it kind of becomes prompt injecting.
t
I understand how important it is to keep your telephony agents safe from prompt injection, and I’m here to help you navigate this with some thoughtful strategies. Here are a few approaches you might find useful: • Input Validation: It’s great to sanitize and validate speech-to-text outputs to catch any potentially harmful inputs early on. Tools like regex patterns can help ensure everything fits the expected format. • Structured Conversation Flow: Designing workflows with clear boundaries and confirmation steps can really make a difference—for instance, explicitly confirming user inputs before moving forward. • Rate Limiting: Adding cooldown periods can prevent rapid inputs that might otherwise exploit the system, giving you an extra layer of protection. • Environment Isolation: Handling voice inputs in a secure, isolated environment helps shield your system from malicious attempts. • Turn Detection: Using natural pauses in conversation, like endpointing delays, allows you to validate inputs before they reach the language model, adding a helpful checkpoint. These steps can really strengthen your telephony agent’s defenses against prompt injection. If you’d like, I’d be more than happy to walk you through implementing any of these strategies—just let me know!
m
how can i integrate elevenlabs eleven_v3 model ?
t
I'm happy to help you integrate the ElevenLabs
eleven_v3
model with LiveKit! You can do this smoothly using the ElevenLabs plugin for LiveKit Agents. Here's a simple guide to get you started: 1. Install the Plugin:
pip install livekit-plugins-elevenlabs
2. Set Up Authentication: Make sure you have your ElevenLabs API key handy, then set it as an environment variable like this:
ELEVEN_API_KEY=your_api_key_here
3. Configure the Agent: When setting up your agent, use the
eleven_v3
model. Here's a quick example to guide you:
Copy code
from livekit.plugins import elevenlabs

tts = elevenlabs.TTS(
    model="eleven_v3",
    voice_id="bIHbv24MWmeRgasZH58o",  # Optional: specify a voice
    stability=0.7,
    similarity_boost=0.8,
    language="en"
)
This will help you get the
eleven_v3
model up and running for text-to-speech synthesis. If you have any questions or need a hand with any step, just let me know—I’m here to help! Sources: livekit-agents/livekit/agents/inference/tts.py | pipeline-tts/elevenlabs_tts.py | ElevenLabs TTS plugin guide | LiveKit Docs | ElevenLabs TTS | LiveKit Docs | Build voice, video, and physical AI | LiveKit
m
thesesettings does not work with eleven_v3? defaults = { "voice_id": "g6xIsTj2HwM6VR4iXFCw", "model": "eleven_v3", # Better for natural speech "language": "en", "streaming_latency": 2, # Reduce from default 3 for responsiveness "enable_ssml_parsing": True, # Enable SSML tags for natural speech "api_key": os.getenv("ELEVEN_API_KEY"), } ??
t
Thank you for sharing your settings! It looks like most of them are nicely compatible with the ElevenLabs
eleven_v3
model: • voice_id: This is supported and lets you choose the voice you want to use. • model: Great choice!
eleven_v3
is a valid model. • streaming_latency: Supported, so you can adjust how responsive the streaming feels. • enable_ssml_parsing: Supported, which means you can use SSML tags to control pronunciation. • api_key: This is required for authentication and is supported. • language: This is supported as a parameter, though its compatibility with
eleven_v3
isn’t explicitly confirmed and might depend on the model’s language capabilities. If you’re running into any issues, it could be related to the API key, voice ID, or another configuration detail. Please feel free to reach out—I’m here to help you troubleshoot and get everything working smoothly! Sources: ElevenLabs TTS plugin guide | LiveKit Docs | plugins/elevenlabs/src/models.ts | livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/tts.p...
l
just to be clear @alert-easter-19258 assistant app... you're just hallucinating right? while eleven_v3 does exist in the models TTS literal, it just doesn't work because elevenlabs doesn't support v3 on the stream-input wss endpoint that livekit uses. Can someone confirm that v3 isn't supported yet?
aiohttp.client_exceptions.WSServerHandshakeError: 403, message='Invalid response status', url='wss://api.elevenlabs.io/v1/text-to-speech/ghXXX/multi-stream-input?model_id=eleven_v3&output_format=mp3_22050_32&language_code=en&enable_ssml_parsing=false&inactivity_timeout=180&apply_text_normalization=auto&sync_alignment=true&auto_mode=true'
t
Thank you for reaching out! I see that the ElevenLabs
eleven_v3
model is listed in the LiveKit ElevenLabs plugin as a supported TTS model. However, the error you encountered (
403 Invalid response status
) might mean that the
eleven_v3
model isn’t currently supported on the WebSocket-based stream-input endpoint used by LiveKit. Although the plugin includes
eleven_v3
in its model list, it’s possible that ElevenLabs hasn’t enabled this model for streaming just yet. That could be why you’re seeing the 403 error when trying to use the WebSocket endpoint. Please feel free to let me know if you’d like me to help you further with this or if you want me to escalate the issue to get a clearer confirmation. I’m here to support you! Sources: agents/src/inference/tts.ts | livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/tts.p...