thankful-rain-68349
11/16/2025, 6:15 AMtall-airline-16756
11/16/2025, 6:15 AMtall-airline-16756
11/16/2025, 6:15 AMos.getenv(). After that, it’s passed along to the different service configurations (like STT, LLM, TTS, VAD) that work with the AgentSession. This way, your sensitive credentials stay safe and sound.
If you’d like me to walk you through any part of the service setup or if something feels unclear, please don’t hesitate to ask. I’m here to help!
Sources: examples/voice_agents/langfuse_trace.pythankful-rain-68349
11/16/2025, 6:22 AMtall-airline-16756
11/16/2025, 6:22 AMOPENAI_API_KEY, the system uses your LiveKit API credentials (LIVEKIT_API_KEY and LIVEKIT_API_SECRET) to authenticate requests through the Agent Gateway API.
This setup is really helpful because it takes away the hassle of managing multiple provider API keys. It also smartly maps the model identifier (like openai/gpt-5-nano) to the right backend provider using LiveKit's infrastructure, making everything smoother for you.
Sources: plugins/openai/src/models.ts | OpenAI LLM models | LiveKit Docs | livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/models.pythankful-rain-68349
11/16/2025, 6:40 AMtall-airline-16756
11/16/2025, 6:40 AMAgentSession for TTS configuration. You have a couple of friendly options to do this:
• Environment Variable (Recommended): You can set your API key in the environment as ELEVEN_API_KEY. The ElevenLabs plugin will then automatically pick it up for you—pretty convenient!
• Direct Argument: Alternatively, you can pass the API key directly in the TTS configuration like this:
from livekit.plugins import elevenlabs
session = AgentSession(
tts=elevenlabs.TTS(
api_key="your_elevenlabs_api_key",
voice_id="iP95p4xoKVk53GoZ742B",
model="eleven_multilingual_v2"
)
# ... other configurations
)
Just a heads-up: if the API key isn’t provided, an error will pop up. If you run into any issues or want me to walk you through it, please don’t hesitate to ask—I’m here to help!
Sources: ElevenLabs TTS plugin guide | LiveKit Docs | livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/stt.p... | examples/src/frontdesk/frontdesk_agent.tsthankful-rain-68349
11/16/2025, 7:45 AMtall-airline-16756
11/16/2025, 7:45 AMAgentSession. Here’s a friendly walkthrough of the process:
1. Final Transcription Event: When the STT system finishes transcribing, it fires an event (like onFinalTranscript) with the text it captured.
2. Updating Chat Context: This transcribed text is then added to the shared ChatContext as a new message from the user, helping keep our conversation history intact.
3. Triggering LLM Inference: The refreshed ChatContext is sent to the LLM during its next inference cycle, so it always has the latest input to work with.
4. LLM Response Generation: Using this updated context, the LLM crafts a response, which is then sent back to the session.
This event-driven setup really helps keep our interactions smooth and responsive. If you’d like, I’m here to provide more details or examples—just let me know!
Sources: agents/src/voice/room_io/room_io.ts | livekit-agents/livekit/agents/voice/agent_session.py | Pipeline nodes and hooks | LiveKit docsthankful-rain-68349
11/16/2025, 7:46 AMtall-airline-16756
11/16/2025, 7:46 AMreasoning_effort and verbosity parameters in extra_kwargs. These get passed to the LLM API, but their behavior can depend on a few important things:
• Model and Provider Support: It’s a good idea to double-check that the model you’re using (like openai/gpt-5-nano) and the provider (openai) actually support these parameters. Sometimes, if they aren’t supported, the parameters might just be ignored.
• Defaulting Behavior: The OpenAI plugin might fill in default values if you don’t specify them. For example, reasoning_effort often defaults to "minimal" unless you set it yourself.
• Subtle Effects: Keep in mind that settings like "minimal" reasoning effort might not create big changes in the output, so it can feel like the parameter isn’t doing much.
Here are a few steps you can try to troubleshoot this:
1. First, confirm that your model and provider support these parameters.
2. Turn on debug logging (for example, by setting LK_OPENAI_DEBUG=1) so you can see if the parameters are actually being sent in your requests.
3. Try experimenting with different values, like "high" reasoning effort, to see if you notice any changes in the responses.
If you’d like, I’m here to help you with any of these steps or to dive deeper into debugging. Just let me know!
Sources: Kimi LLM | LiveKit Docs | DeepSeek LLM | LiveKit Docs | livekit-agents/livekit/agents/voice/agent_session.py | agents/src/inference/llm.ts | OpenAI LLM models | LiveKit Docsthankful-rain-68349
11/16/2025, 9:55 AMtall-airline-16756
11/16/2025, 9:55 AMthankful-rain-68349
11/16/2025, 9:56 AMtall-airline-16756
11/16/2025, 9:57 AM