great-oil-61627
10/01/2025, 10:13 PMtall-airline-16756
10/01/2025, 10:13 PMtall-airline-16756
10/01/2025, 10:13 PMgreat-oil-61627
10/01/2025, 10:14 PMtall-airline-16756
10/01/2025, 10:15 PMChatContext object to manage your conversation history and pass it along to the agent. Feel free to dynamically update the context with update_chat_ctx() or tweak it just before processing using the before_llm_cb callback.
• TTS Parameters: When setting up, you can configure parameters like voice, language, and model, or update them on the fly using plugin-specific methods such as update_options().
• STT Context: For domain-specific context like vocabulary or translation hints, you can pass them through the context parameter for plugins like Soniox or Gladia.
• Model Settings: The ModelSettings class is a great way to pass parameters like tool choices or other configurations you might need.
• Runtime Context: You can also access session state and metadata during runtime by using the RunContext parameter in your tools.
• Text Preprocessing: If you'd like to customize text before sending it to TTS, try the before_tts_cb callback or handle structured output with transcription_node.
If you'd like, I can provide specific examples or dive deeper into any of these methods—just let me know! I'm here to help you every step of the way.
Sources: VoicePipelineAgent | LiveKit Docs | livekit-plugins/livekit-plugins-gladia/livekit/plugins/gladia/stt.py | LMNT TTS integration guide | LiveKit Docs | Soniox STT integration guide | LiveKit Docs | Google integration guide | LiveKit Docsgreat-oil-61627
10/01/2025, 10:16 PMtall-airline-16756
10/01/2025, 10:17 PMmetadata field in JobContext. It’s perfect for setting up the agent with user details right at the start of a session.
• Context Variables: You can use a dictionary of variables (such as name and language) to dynamically add them into agent instructions. This works well for simple, dynamic setups.
• ChatContext: This helps you manage the conversation history and even pre-populate it with initial prompts. It’s the best choice when you want to guide the dialogue flow and keep context during the session.
• RunContext.UserData: This lets you attach custom data to the agent’s session for things like game state or user preferences. It’s accessible throughout the session in tool functions, which can be really handy.
• STT Parameters: If you want to automatically detect the spoken language from audio input, enabling language detection in STT plugins (like Soniox) is the way to go.
Each of these methods has its own strengths depending on what you need. For static info like usernames, Job Metadata is your friend. For dynamic instructions, go with Context Variables. To manage the flow of conversation, ChatContext is ideal. And for session-specific states, RunContext.UserData really shines. If you’d like, I’m happy to share examples or dive deeper into any of these—just let me know!
Sources: Docs::Agents | complex-agents/role-playing/agent.py | examples/voice_agents/realtime_joke_teller.py | Soniox STT integration guide | LiveKit Docs