Agent Framework plugin for services using IndusLabs API.
Project description
LiveKit IndusLabs Plugin
Official LiveKit Agents plugin for IndusLabs Text-to-Speech (TTS) and Speech-to-Text (STT).
Installation
pip install livekit-plugins-induslabs
Setup
Get your API key from induslabs.io and set it:
export INDUSLABS_API_KEY="your-api-key-here"
export LIVEKIT_URL="ws://localhost:7880"
export LIVEKIT_API_KEY="your-livekit-key"
export LIVEKIT_API_SECRET="your-livekit-secret"
Basic Agent
from dotenv import load_dotenv
from livekit import agents
from livekit.agents import AgentSession, Agent
from livekit.plugins import openai, silero
from livekit.plugins.induslabs import TTS, STT
load_dotenv()
class VoiceAssistant(Agent):
def __init__(self):
super().__init__(
instructions="You are a helpful voice assistant."
)
async def entrypoint(ctx: agents.JobContext):
session = AgentSession(
stt=STT(),
tts=TTS(voice="Indus-hi-Urvashi"),
llm=openai.LLM(model="gpt-4o-mini"),
vad=silero.VAD.load(),
)
await session.start(room=ctx.room, agent=VoiceAssistant())
await session.generate_reply(
instructions="Greet the user warmly."
)
if __name__ == "__main__":
agents.cli.run_app(agents.WorkerOptions(entrypoint_fnc=entrypoint))
Run with:
python agent.py dev
TTS Usage
from livekit.plugins.induslabs import TTS
# Basic
tts = TTS(voice="Indus-hi-Urvashi")
# With options
tts = TTS(
voice="Indus-hi-Urvashi",
sample_rate=24000,
speed=1.2,
pitch_shift=2.0,
loudness_db=3.0,
)
# Streaming
stream = tts.stream()
stream.push("Hello world")
stream.flush()
async for event in stream:
audio_frame = event.frame
Available Voices
Indus-hi-Urvashi– Hindi, femaleIndus-en-Aarav– English, male
STT Usage
from livekit.plugins.induslabs import STT
# Basic
stt = STT()
# With language
stt = STT(language="hi") # Hindi
# Streaming
stream = stt.stream(language="en")
async for event in stream:
if event.type == SpeechEventType.FINAL_TRANSCRIPT:
print(event.alternatives[0].text)
Configuration
TTS Options
| Parameter | Default | Description |
|---|---|---|
voice |
"Indus-hi-Urvashi" |
Voice ID |
sample_rate |
24000 | Audio sample rate |
speed |
1.0 | Playback speed |
pitch_shift |
0.0 | Pitch (semitones) |
loudness_db |
0.0 | Volume (dB) |
STT Options
| Parameter | Default | Description |
|---|---|---|
sample_rate |
16000 | Audio sample rate |
language |
None | Language code (auto-detect) |
Support
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file livekit_plugins_induslabs-0.0.3.tar.gz.
File metadata
- Download URL: livekit_plugins_induslabs-0.0.3.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
668f51cc1408e372f8a6a25bfd6d415d92e29c25e9d4d40b61245928c8288157
|
|
| MD5 |
d3d7b975c41e6f65d723dc21ca5c3908
|
|
| BLAKE2b-256 |
24cf9818d64f3b3039812977f826dcdcb4427a52c6672a93bcc68b52ec143104
|
File details
Details for the file livekit_plugins_induslabs-0.0.3-py3-none-any.whl.
File metadata
- Download URL: livekit_plugins_induslabs-0.0.3-py3-none-any.whl
- Upload date:
- Size: 14.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3def23a921dadbabd13ffe7202162bd0d4f93045a8495854c42343a15cea999f
|
|
| MD5 |
f6d7e89b4f2c826b093f0db44997538a
|
|
| BLAKE2b-256 |
e81bc8b6cc6f8a4a3ef864908fa637908ce5359f34f2443ce72d28d6b0730d66
|