I have an agent that transcribes the voice using d...
# ask-ai
a
I have an agent that transcribes the voice using deepgram stt module and listening to sip participant . I join as web participant to the room and I want agent to transcribe web voice too. How?
t
Thanks for reaching out, Sasha. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
To enable your agent to transcribe both SIP and web participants in a LiveKit room using the Deepgram STT module, follow these steps: 1. Set Up Environment Variables: Ensure your Deepgram API key is set in the
.env
file as
DEEPGRAM_API_KEY
. 2. Install the Deepgram Plugin: Run
pip install "livekit-agents[deepgram]~=1.0"
. 3. Initialize Deepgram STT: Create a function to configure the STT module with options like interim results, punctuation, and language. 4. Configure the Agent: Define an agent class to handle transcription and log events. 5. Set Up AgentSession: Use
AgentSession.start
to include both SIP and web participants by specifying
rtc.ParticipantKind.PARTICIPANT_KIND_SIP
and
rtc.ParticipantKind.PARTICIPANT_KIND_STANDARD
in
RoomInputOptions
. 6. Handle Multiple Participants: Implement logic to start a session for each participant dynamically as they join the room. For detailed code examples and additional considerations, refer to the Deepgram STT Integration Guide and LiveKit Agents Framework Documentation.
a
how to enable debug logging for stt module
t
Hey there! If you want to enable debug logging for the STT module in LiveKit, here are a couple of easy ways to do it: 1. Using `initializeLogger`: This sets up logging for the STT module in a snap.
Copy code
import { initializeLogger } from '@livekit/agents';

initializeLogger({ 
    pretty: false,
    level: 'debug'
});
2. Using `setLogExtension`: This lets you send logs to external providers like Datadog, which is super handy.
Copy code
import { setLogExtension } from '@livekit/agents';

setLogExtension((level, msg, context) => {
    // Just plug in your log provider's API here to send this log message and context
});
These options will get you detailed debug logs for the STT module in no time. If you have any questions or want a hand with anything else, just let me know—I’m here to help! Sources: Logs, metrics, and telemetry | LiveKit Docs | Voice Assistants | livekit/livekit_composite | DeepWiki