How do I use custom deepgram.STT url?
# ask-ai
f
How do I use custom deepgram.STT url?
t
Thanks for reaching out, Taras. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm happy to help you set up a custom Deepgram STT URL in LiveKit! You can do this by configuring the
base_url
parameter when you initialize your Deepgram STT instance. Python Implementation: • STT v1:
Copy code
from livekit.plugins import deepgram

stt = deepgram.STT(
    base_url="https://your-custom-deepgram-url.com/v1/listen",
    # other parameters...
)
• STT v2:
Copy code
from livekit.plugins.deepgram import STTv2

stt = deepgram.STTv2(
    base_url="wss://your-custom-deepgram-url.com/v2/listen",
    # other parameters...
)
And if you ever need to update the URL after initialization, you can easily do so using the
update_options
method like this:
Copy code
# For STT v1
stt.update_options(endpoint_url="https://new-custom-url.com/v1/listen")

# For STT v2
stt.update_options(endpoint_url="wss://new-custom-url.com/v2/listen")
JavaScript/Node.js Implementation: For JavaScript, you can configure the
base_url
in a similar way. The exact details depend on the
STTOptions
interface, so I recommend checking out the official JavaScript plugin reference documentation for more information. If you have any questions or need help with a specific scenario, please don’t hesitate to reach out. I’m here to support you every step of the way! Sources: examples/voice_agents/error_callback.py | examples/src/cartersia_tts.ts
f
@white-telephone-81843 wrong thread
🙌 1
t
I'd love to share a Python script that gently walks you through creating, deleting, listing, and joining rooms in LiveKit. Let's explore it together:
Copy code
import asyncio
from livekit import api
import os

async def room_management_demo():
    # Initialize LiveKit API client
    # Uses LIVEKIT_URL, LIVEKIT_API_KEY, LIVEKIT_API_SECRET env vars
    lkapi = api.LiveKitAPI()
    
    try:
        # 1. Create a room
        print("Creating room...")
        room_info = await lkapi.room.create_room(
            api.CreateRoomRequest(
                name="my-demo-room",
                empty_timeout=300,  # Keep room open for 5 minutes if empty
                max_participants=10,
                metadata="Demo room for testing"
            )
        )
        print(f"Created room: {room_info.name} (SID: {room_info.sid})")
        
        # 2. List all rooms
        print("\nListing all rooms...")
        room_list = await lkapi.room.list_rooms(api.ListRoomsRequest())
        for room in room_list.rooms:
            print(f"Room: {room.name} (SID: {room.sid}, Participants: {room.num_participants})")
        
        # 3. Delete the room
        print("\nDeleting room...")
        await lkapi.room.delete_room(
            api.DeleteRoomRequest(room="my-demo-room")
        )
        print("Room deleted successfully")
        
    except Exception as e:
        print(f"Error: {e}")
    finally:
        await lkapi.aclose()

if __name__ == "__main__":
    asyncio.run(room_management_demo())
Before you run this script, please make sure you've set these environment variables to connect smoothly:
Copy code
export LIVEKIT_URL="wss://your-livekit-server.com"
export LIVEKIT_API_KEY="your-api-key"
export LIVEKIT_API_SECRET="your-api-secret"
If you have any questions or would like me to provide examples in other programming languages, please don't hesitate to ask. I'm here to help you every step of the way! Sources: livekit-api/src/services/room.rs | Managing rooms | LiveKit Docs | cmd/lk/room.go | examples/api.py