in AgentSession i want to use deepgram STT
# ask-ai
b
in AgentSession i want to use deepgram STT
t
Thanks for reaching out, Mayank. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Here’s a simple way to get started with Deepgram’s Speech-to-Text (STT) in an `AgentSession`: 1. Install the Plugin: First, install the LiveKit Deepgram plugin using pip:
pip install "livekit-agents[deepgram]~=1.2"
2. Set Up Authentication: Grab your Deepgram API key from the Deepgram Console and set it as an environment variable like this:
DEEPGRAM_API_KEY=<your_api_key>
3. Integrate with AgentSession: Then, use this code snippet to hook up Deepgram STT:
Copy code
from livekit.plugins import deepgram
session = AgentSession(
    stt=deepgram.STT(
        model="nova-3",  # This is optional and defaults to 'nova-3'
    ),
    # ... you can add other components like llm, tts, etc.
)
4. Optional Customization: Feel free to tweak the STT settings with options like language, endpointing duration, and key terms:
Copy code
stt=deepgram.STT(
    model="nova-3",
    language="en-US",
    endpointing_ms=25,
    keyterms=["LiveKit", "AI"],
)
The
AgentSession
takes care of voice activity detection (VAD) to kick off the STT process smoothly. If you want to dive deeper, check out the Voice AI Quickstart Guide. Happy coding! Sources: livekit-plugins/livekit-plugins-deepgram/README.md | plugins/deepgram/src/index.ts | Deepgram STT integration guide | LiveKit Docs | Deepgram STT integration guide | LiveKit Docs | Speech-to-text (STT) integrations | LiveKit Docs