Papla Media TTS
The Papla Media TTS provider enables your agent to use Papla Media's text-to-speech service for converting text responses into spoken audio.
Installation
Install the Papla Media-enabled VideoSDK Agents package:
pip install "videosdk-plugins-papla"
Importing
from videosdk.plugins.papla import PaplaTTS
Authentication
The Papla Media plugin requires an API key, which you can generate from your app dashboard.
Set PAPLA_API_KEY
in your .env
file.
Example Usage
from videosdk.plugins.papla import PaplaTTS
from videosdk.agents import CascadingPipeline
# Initialize the Papla Media TTS service
tts = PaplaMediaTTS(
# When PAPLA_API_KEY is set in .env - DON'T pass api_key parameter
api_key="your-papla-media-api-key",
)
# Add tts to a cascading pipeline
pipeline = CascadingPipeline(tts=tts)
When using a .env
file for credentials, don't pass them as arguments to model instances. The SDK automatically reads environment variables, so you should omit the api_key
parameter from your code.
Configuration Options
Initialization Parameters
These are the options you can set when creating an instance of PaplaMediaTTS
.
model_id
(str): The TTS model to use. Defaults to"papla_p1"
.api_key
(str, optional): Your Papla Media API key. It's recommended to set this via thePAPLA_API_KEY
environment variable instead.base_url
(str, optional): Custom base URL for the Papla Media API. Defaults to"https://api.papla.media/v1"
.
Additional Resources
The following resources provide more information about using Papla Media with the VideoSDK Agent Framework.
-
Python package: The
videosdk-plugins-papla
package on PyPI. -
GitHub repo: View the source or contribute to the VideoSDK Papla Media TTS plugin.
-
Papla Media API Docs: Papla Media's official API documentation.
Got a Question? Ask us on discord