livekit-plugins-talklabs


Namelivekit-plugins-talklabs JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/talklabs/livekit-plugins-talklabs
SummaryTalkLabs TTS plugin for LiveKit Agents
upload_time2025-10-30 20:10:53
maintainerNone
docs_urlNone
authorTalkLabs
requires_python>=3.9
licenseMIT
keywords livekit webrtc realtime tts text-to-speech talklabs portuguese
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # livekit-plugins-talklabs

[![Python](https://img.shields.io/badge/python-3.9%2B-blue)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![LiveKit](https://img.shields.io/badge/LiveKit-Compatible-green)](https://livekit.io)
[![PyPI version](https://badge.fury.io/py/livekit-plugins-talklabs.svg)](https://badge.fury.io/py/livekit-plugins-talklabs)

TalkLabs TTS plugin for [LiveKit Agents](https://github.com/livekit/agents). Provides high-quality Brazilian Portuguese text-to-speech synthesis with streaming support.

## Installation

```bash
pip install livekit-plugins-talklabs
```

## Compatibility

This plugin is compatible with LiveKit Agents Framework and can be used as a drop-in TTS provider alongside other LiveKit plugins:
- ✅ Works with LiveKit Voice Assistant
- ✅ Compatible with all LiveKit STT providers (Deepgram, OpenAI, etc.)
- ✅ Compatible with all LiveKit LLM providers (OpenAI, Anthropic, etc.)

## Usage

### Basic Example

```python
from livekit.plugins.talklabs import TalkLabsTTS

# Initialize TTS (same pattern as other LiveKit plugins)
tts = TalkLabsTTS(
    api_key="your-api-key"  # Get from https://talklabs.com.br
)

# Use with default voice (adam_rocha)
tts = TalkLabsTTS(api_key="your-api-key")

# Or specify custom settings
tts = TalkLabsTTS(
    api_key="your-api-key",
    voice="maria_silva",    # Female voice
    language="pt",          # Portuguese
    speed=1.2,             # Slightly faster
    sample_rate=24000      # High quality
)
```

### With LiveKit Voice Assistant

```python
from livekit.agents import JobContext, WorkerOptions, cli
from livekit.agents.voice_assistant import VoiceAssistant
from livekit.plugins.openai import LLM
from livekit.plugins.deepgram import STT
from livekit.plugins.silero import VAD
from livekit.plugins.talklabs import TalkLabsTTS
import os

async def entrypoint(ctx: JobContext):
    # Create a voice assistant with TalkLabs TTS
    assistant = VoiceAssistant(
        vad=VAD.load(),
        stt=STT(),
        llm=LLM(),
        tts=TalkLabsTTS(api_key=os.environ["TALKLABS_API_KEY"])  # Same as other plugins
    )

    await assistant.start(ctx.room)

if __name__ == "__main__":
    cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint))
```

### Complete Integration Example

```python
from livekit.agents import JobContext, WorkerOptions, cli
from livekit.agents.voice_assistant import VoiceAssistant
from livekit.plugins.openai import LLM
from livekit.plugins.deepgram import STT
from livekit.plugins.silero import VAD
from livekit.plugins.talklabs import TalkLabsTTS
import os

async def entrypoint(ctx: JobContext):
    """LiveKit Voice Assistant with Brazilian Portuguese support."""

    # Initialize plugins - all follow same pattern
    vad = VAD.load()
    stt = STT(language="pt-BR")  # Portuguese speech recognition
    llm = LLM(model="gpt-4")
    tts = TalkLabsTTS(api_key=os.environ["TALKLABS_API_KEY"])  # Portuguese TTS

    # Create voice assistant
    assistant = VoiceAssistant(
        vad=vad,
        stt=stt,
        llm=llm,
        tts=tts,  # TalkLabs as TTS provider
    )

    # Set Portuguese context
    assistant.llm_context.append({
        "role": "system",
        "content": "You are a helpful assistant. Respond in Portuguese (pt-BR)."
    })

    await assistant.start(ctx.room)

    # Greet in Portuguese
    await assistant.say("Olá! Como posso ajudá-lo hoje?")

if __name__ == "__main__":
    cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint))
```

## Available Voices

| Voice | Gender | Description |
|-------|--------|-------------|
| `adam_rocha` | Male | Default voice, natural Brazilian accent |
| `maria_silva` | Female | Clear and professional |
| `carlos_santos` | Male | Deep and authoritative |
| `ana_costa` | Female | Young and friendly |

## Configuration

### Environment Variables

Set your API key as an environment variable:

```bash
export TALKLABS_API_KEY="your-api-key"
```

Then use it in your code:

```python
tts = TalkLabsTTS(api_key=os.environ["TALKLABS_API_KEY"])
```

### Parameters

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `api_key` | str | Required | Your TalkLabs API key |
| `voice` | str | `"adam_rocha"` | Voice identifier |
| `language` | str | `"pt"` | Language code |
| `speed` | float | `1.0` | Speech speed (0.5-2.0) |
| `sample_rate` | int | `24000` | Audio sample rate |
| `base_url` | str | `"https://api.talklabs.com.br"` | API endpoint |

## Comparison with Other LiveKit TTS Plugins

| Plugin | Languages | Streaming | Best For |
|--------|-----------|-----------|----------|
| **livekit-plugins-talklabs** | Portuguese (pt-BR) | ✅ | Brazilian Portuguese applications |
| livekit-plugins-openai | Multiple | ✅ | General purpose, English |
| livekit-plugins-elevenlabs | Multiple | ✅ | High quality English voices |
| livekit-plugins-cartesia | English | ✅ | Low latency English |

## Working Example

```python
import asyncio
import os
from livekit.agents import JobContext, WorkerOptions, cli
from livekit.agents.voice_assistant import VoiceAssistant
from livekit.plugins.openai import LLM
from livekit.plugins.deepgram import STT
from livekit.plugins.silero import VAD
from livekit.plugins.talklabs import TalkLabsTTS

async def entrypoint(ctx: JobContext):
    """Minimal working example."""

    # Simple one-line TTS initialization like other plugins
    assistant = VoiceAssistant(
        vad=VAD.load(),
        stt=STT(),
        llm=LLM(),
        tts=TalkLabsTTS(api_key=os.environ["TALKLABS_API_KEY"])
    )

    await assistant.start(ctx.room)

if __name__ == "__main__":
    cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint))
```

## Features

- 🎯 **Native LiveKit Integration**: Works seamlessly with LiveKit Agents Framework
- 🔄 **Streaming Support**: Real-time audio streaming for low latency
- 🇧🇷 **Brazilian Portuguese**: Optimized for pt-BR pronunciation
- ⚡ **Low Latency**: < 200ms to first byte
- 🎵 **High Quality**: 24kHz sample rate
- 🔌 **Plugin Architecture**: Drop-in replacement for any LiveKit TTS provider

## Requirements

- Python 3.9+
- LiveKit Agents 0.8.0+
- TalkLabs API key (get from [talklabs.com.br](https://talklabs.com.br))

## Support

- 📧 **Email**: support@talklabs.com.br
- 📖 **Documentation**: [docs.talklabs.com.br](https://docs.talklabs.com.br)
- 🐛 **Issues**: [GitHub Issues](https://github.com/talklabs/livekit-plugins-talklabs/issues)

## License

MIT License - see [LICENSE](LICENSE) file for details.

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

---

<div align="center">
Made with ❤️ by <a href="https://talklabs.com.br">TalkLabs</a> for the LiveKit community
</div>

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/talklabs/livekit-plugins-talklabs",
    "name": "livekit-plugins-talklabs",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "livekit, webrtc, realtime, tts, text-to-speech, talklabs, portuguese",
    "author": "TalkLabs",
    "author_email": "TalkLabs <support@talklabs.com.br>",
    "download_url": "https://files.pythonhosted.org/packages/62/6f/a06fa317965d504012ff8e776ecb2113ba48def4be065266986dc52dcd45/livekit_plugins_talklabs-1.0.0.tar.gz",
    "platform": null,
    "description": "# livekit-plugins-talklabs\n\n[![Python](https://img.shields.io/badge/python-3.9%2B-blue)](https://www.python.org/downloads/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![LiveKit](https://img.shields.io/badge/LiveKit-Compatible-green)](https://livekit.io)\n[![PyPI version](https://badge.fury.io/py/livekit-plugins-talklabs.svg)](https://badge.fury.io/py/livekit-plugins-talklabs)\n\nTalkLabs TTS plugin for [LiveKit Agents](https://github.com/livekit/agents). Provides high-quality Brazilian Portuguese text-to-speech synthesis with streaming support.\n\n## Installation\n\n```bash\npip install livekit-plugins-talklabs\n```\n\n## Compatibility\n\nThis plugin is compatible with LiveKit Agents Framework and can be used as a drop-in TTS provider alongside other LiveKit plugins:\n- \u2705 Works with LiveKit Voice Assistant\n- \u2705 Compatible with all LiveKit STT providers (Deepgram, OpenAI, etc.)\n- \u2705 Compatible with all LiveKit LLM providers (OpenAI, Anthropic, etc.)\n\n## Usage\n\n### Basic Example\n\n```python\nfrom livekit.plugins.talklabs import TalkLabsTTS\n\n# Initialize TTS (same pattern as other LiveKit plugins)\ntts = TalkLabsTTS(\n    api_key=\"your-api-key\"  # Get from https://talklabs.com.br\n)\n\n# Use with default voice (adam_rocha)\ntts = TalkLabsTTS(api_key=\"your-api-key\")\n\n# Or specify custom settings\ntts = TalkLabsTTS(\n    api_key=\"your-api-key\",\n    voice=\"maria_silva\",    # Female voice\n    language=\"pt\",          # Portuguese\n    speed=1.2,             # Slightly faster\n    sample_rate=24000      # High quality\n)\n```\n\n### With LiveKit Voice Assistant\n\n```python\nfrom livekit.agents import JobContext, WorkerOptions, cli\nfrom livekit.agents.voice_assistant import VoiceAssistant\nfrom livekit.plugins.openai import LLM\nfrom livekit.plugins.deepgram import STT\nfrom livekit.plugins.silero import VAD\nfrom livekit.plugins.talklabs import TalkLabsTTS\nimport os\n\nasync def entrypoint(ctx: JobContext):\n    # Create a voice assistant with TalkLabs TTS\n    assistant = VoiceAssistant(\n        vad=VAD.load(),\n        stt=STT(),\n        llm=LLM(),\n        tts=TalkLabsTTS(api_key=os.environ[\"TALKLABS_API_KEY\"])  # Same as other plugins\n    )\n\n    await assistant.start(ctx.room)\n\nif __name__ == \"__main__\":\n    cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint))\n```\n\n### Complete Integration Example\n\n```python\nfrom livekit.agents import JobContext, WorkerOptions, cli\nfrom livekit.agents.voice_assistant import VoiceAssistant\nfrom livekit.plugins.openai import LLM\nfrom livekit.plugins.deepgram import STT\nfrom livekit.plugins.silero import VAD\nfrom livekit.plugins.talklabs import TalkLabsTTS\nimport os\n\nasync def entrypoint(ctx: JobContext):\n    \"\"\"LiveKit Voice Assistant with Brazilian Portuguese support.\"\"\"\n\n    # Initialize plugins - all follow same pattern\n    vad = VAD.load()\n    stt = STT(language=\"pt-BR\")  # Portuguese speech recognition\n    llm = LLM(model=\"gpt-4\")\n    tts = TalkLabsTTS(api_key=os.environ[\"TALKLABS_API_KEY\"])  # Portuguese TTS\n\n    # Create voice assistant\n    assistant = VoiceAssistant(\n        vad=vad,\n        stt=stt,\n        llm=llm,\n        tts=tts,  # TalkLabs as TTS provider\n    )\n\n    # Set Portuguese context\n    assistant.llm_context.append({\n        \"role\": \"system\",\n        \"content\": \"You are a helpful assistant. Respond in Portuguese (pt-BR).\"\n    })\n\n    await assistant.start(ctx.room)\n\n    # Greet in Portuguese\n    await assistant.say(\"Ol\u00e1! Como posso ajud\u00e1-lo hoje?\")\n\nif __name__ == \"__main__\":\n    cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint))\n```\n\n## Available Voices\n\n| Voice | Gender | Description |\n|-------|--------|-------------|\n| `adam_rocha` | Male | Default voice, natural Brazilian accent |\n| `maria_silva` | Female | Clear and professional |\n| `carlos_santos` | Male | Deep and authoritative |\n| `ana_costa` | Female | Young and friendly |\n\n## Configuration\n\n### Environment Variables\n\nSet your API key as an environment variable:\n\n```bash\nexport TALKLABS_API_KEY=\"your-api-key\"\n```\n\nThen use it in your code:\n\n```python\ntts = TalkLabsTTS(api_key=os.environ[\"TALKLABS_API_KEY\"])\n```\n\n### Parameters\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `api_key` | str | Required | Your TalkLabs API key |\n| `voice` | str | `\"adam_rocha\"` | Voice identifier |\n| `language` | str | `\"pt\"` | Language code |\n| `speed` | float | `1.0` | Speech speed (0.5-2.0) |\n| `sample_rate` | int | `24000` | Audio sample rate |\n| `base_url` | str | `\"https://api.talklabs.com.br\"` | API endpoint |\n\n## Comparison with Other LiveKit TTS Plugins\n\n| Plugin | Languages | Streaming | Best For |\n|--------|-----------|-----------|----------|\n| **livekit-plugins-talklabs** | Portuguese (pt-BR) | \u2705 | Brazilian Portuguese applications |\n| livekit-plugins-openai | Multiple | \u2705 | General purpose, English |\n| livekit-plugins-elevenlabs | Multiple | \u2705 | High quality English voices |\n| livekit-plugins-cartesia | English | \u2705 | Low latency English |\n\n## Working Example\n\n```python\nimport asyncio\nimport os\nfrom livekit.agents import JobContext, WorkerOptions, cli\nfrom livekit.agents.voice_assistant import VoiceAssistant\nfrom livekit.plugins.openai import LLM\nfrom livekit.plugins.deepgram import STT\nfrom livekit.plugins.silero import VAD\nfrom livekit.plugins.talklabs import TalkLabsTTS\n\nasync def entrypoint(ctx: JobContext):\n    \"\"\"Minimal working example.\"\"\"\n\n    # Simple one-line TTS initialization like other plugins\n    assistant = VoiceAssistant(\n        vad=VAD.load(),\n        stt=STT(),\n        llm=LLM(),\n        tts=TalkLabsTTS(api_key=os.environ[\"TALKLABS_API_KEY\"])\n    )\n\n    await assistant.start(ctx.room)\n\nif __name__ == \"__main__\":\n    cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint))\n```\n\n## Features\n\n- \ud83c\udfaf **Native LiveKit Integration**: Works seamlessly with LiveKit Agents Framework\n- \ud83d\udd04 **Streaming Support**: Real-time audio streaming for low latency\n- \ud83c\udde7\ud83c\uddf7 **Brazilian Portuguese**: Optimized for pt-BR pronunciation\n- \u26a1 **Low Latency**: < 200ms to first byte\n- \ud83c\udfb5 **High Quality**: 24kHz sample rate\n- \ud83d\udd0c **Plugin Architecture**: Drop-in replacement for any LiveKit TTS provider\n\n## Requirements\n\n- Python 3.9+\n- LiveKit Agents 0.8.0+\n- TalkLabs API key (get from [talklabs.com.br](https://talklabs.com.br))\n\n## Support\n\n- \ud83d\udce7 **Email**: support@talklabs.com.br\n- \ud83d\udcd6 **Documentation**: [docs.talklabs.com.br](https://docs.talklabs.com.br)\n- \ud83d\udc1b **Issues**: [GitHub Issues](https://github.com/talklabs/livekit-plugins-talklabs/issues)\n\n## License\n\nMIT License - see [LICENSE](LICENSE) file for details.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n---\n\n<div align=\"center\">\nMade with \u2764\ufe0f by <a href=\"https://talklabs.com.br\">TalkLabs</a> for the LiveKit community\n</div>\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "TalkLabs TTS plugin for LiveKit Agents",
    "version": "1.0.0",
    "project_urls": {
        "Documentation": "https://docs.talklabs.com.br",
        "Homepage": "https://github.com/talklabs/livekit-plugins-talklabs",
        "Issues": "https://github.com/talklabs/livekit-plugins-talklabs/issues",
        "Repository": "https://github.com/talklabs/livekit-plugins-talklabs"
    },
    "split_keywords": [
        "livekit",
        " webrtc",
        " realtime",
        " tts",
        " text-to-speech",
        " talklabs",
        " portuguese"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "94fd2bd44424ff111832b0206eb4dbc833d3538faebf757ec20d02f2e41d4ae9",
                "md5": "42b54def90ef3e3bf0823676a7525357",
                "sha256": "a5491611dfb7b263645dcddd9b8e728af246c15afdf8de35b16e1c88c53b4835"
            },
            "downloads": -1,
            "filename": "livekit_plugins_talklabs-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "42b54def90ef3e3bf0823676a7525357",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 7785,
            "upload_time": "2025-10-30T20:10:52",
            "upload_time_iso_8601": "2025-10-30T20:10:52.093192Z",
            "url": "https://files.pythonhosted.org/packages/94/fd/2bd44424ff111832b0206eb4dbc833d3538faebf757ec20d02f2e41d4ae9/livekit_plugins_talklabs-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "626fa06fa317965d504012ff8e776ecb2113ba48def4be065266986dc52dcd45",
                "md5": "80e5dd3fc1f27f8ea147e8d0fe9695b8",
                "sha256": "0ad5dedb66928e99917216c026dd2b3c3a4b8f3e27721cc4e76393f9f483cb72"
            },
            "downloads": -1,
            "filename": "livekit_plugins_talklabs-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "80e5dd3fc1f27f8ea147e8d0fe9695b8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 10452,
            "upload_time": "2025-10-30T20:10:53",
            "upload_time_iso_8601": "2025-10-30T20:10:53.548020Z",
            "url": "https://files.pythonhosted.org/packages/62/6f/a06fa317965d504012ff8e776ecb2113ba48def4be065266986dc52dcd45/livekit_plugins_talklabs-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-30 20:10:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "talklabs",
    "github_project": "livekit-plugins-talklabs",
    "github_not_found": true,
    "lcname": "livekit-plugins-talklabs"
}
        
Elapsed time: 2.81206s