billowy-psychiatrist-32507
08/29/2025, 1:08 PMtall-airline-16756
08/29/2025, 1:09 PMtall-airline-16756
08/29/2025, 1:09 PMAgentSession
, here’s a friendly step-by-step to help you out:
1. Install the AWS Plugin: Just run this command to get the LiveKit AWS plugin set up:
pip install "livekit-agents[aws]~=1.2"
2. Set Up AWS Authentication: Next, add your AWS credentials to your .env
file like this:
AWS_ACCESS_KEY_ID=<your-aws-access-key-id>
AWS_SECRET_ACCESS_KEY=<your-aws-secret-access-key>
AWS_DEFAULT_REGION=<your-aws-region>
3. Update Your `AgentSession`: Swap out the OpenAI TTS for Amazon Polly TTS. Here’s a simple example to get you started:
from livekit.plugins import aws
session = AgentSession(
tts=aws.TTS(
voice="Ruth",
speech_engine="generative",
language="en-US"
),
# Include other components like llm, stt, etc.
)
4. Customize Polly TTS Parameters: Feel free to tweak the voice, speech engine, language, and sample rate to suit your needs. For example:
tts_instance = aws.TTS(
voice="Joanna",
speech_engine="neural",
language="en-US",
text_type="ssml",
sample_rate=22050,
region="us-west-2"
)
5. Optional: Use SSML for Advanced Speech Control: If you want more control over how the speech sounds, just set text_type="ssml"
and use SSML-formatted text.
If you want to dive deeper, check out the Amazon Polly TTS integration guide. I’m here if you need any help along the way!
Sources: Amazon Polly TTS integration guide | LiveKit Docs | livekit-plugins/livekit-plugins-aws/livekit/plugins/aws/tts.py | AWS AI and LiveKit | LiveKit Docs | Text-to-speech (TTS) integrations | LiveKit Docsbillowy-psychiatrist-32507
09/01/2025, 7:07 AMtts=aws.TTS(
voice="Ruth",
speech_engine="generative",
language="en-US"
),
and while running my application i got following error
[2025-09-01 123529] [ERROR] livekit.agents: Error in _tts_inference_task
Traceback (most recent call last):
File "C:\Python312\Lib\site-packages\livekit\agents\utils\log.py", line 16, in async_fn_logs
return await fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\opentelemetry\util\_decorator.py", line 71, in async_wrapper
return await func(*args, **kwargs) # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\livekit\agents\voice\generation.py", line 212, in _tts_inference_task
async for audio_frame in tts_node:
File "C:\Python312\Lib\site-packages\livekit\agents\voice\agent.py", line 391, in tts_node
if not activity.tts.capabilities.streaming:
^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'tuple' object has no attribute 'capabilities'
{"message": "Error in _tts_inference_task", "level": "ERROR", "name": "livekit.agents", "exc_info": "Traceback (most recent call last):\n File \"C:\\Python312\\Lib\\site-packages\\livekit\\agents\\utils\\log.py\", line 16, in async_fn_logs\n return await fn(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Python312\\Lib\\site-packages\\opentelemetry\\util\\_decorator.py\", line 71, in async_wrapper\n return await func(*args, **kwargs) # type: ignore\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Python312\\Lib\\site-packages\\livekit\\agents\\voice\\generation.py\", line 212, in _tts_inference_task\n async for audio_frame in tts_node:\n File \"C:\\Python312\\Lib\\site-packages\\livekit\\agents\\voice\\agent.py\", line 391, in tts_node\n if not activity.tts.capabilities.streaming:\n ^^^^^^^^^^^^^^^^^^^^^^^^^\nAttributeError: 'tuple' object has no attribute 'capabilities'", "timestamp": "2025-09-01T070529.649707+00:00"}tall-airline-16756
09/01/2025, 7:08 AMAttributeError: 'tuple' object has no attribute 'capabilities'
usually pops up when the capabilities
parameter in your TTS setup is accidentally passed as a tuple or some other type instead of a TTSCapabilities
object.
No worries though! To fix it, just make sure that the capabilities
parameter is created as a proper TTSCapabilities
object. Here’s a quick example to guide you:
from livekit.agents.tts import TTSCapabilities
tts_instance = aws.TTS(
voice="Ruth",
speech_engine="generative",
language="en-US",
capabilities=TTSCapabilities(
streaming=True,
aligned_transcript=False
)
)
Just double-check that all the parameters are set up right, and this should clear things up. If you hit any other bumps, feel free to reach out—I’m here to help!
Sources: livekit-plugins/livekit-plugins-smallestai/livekit/plugins/smallestai/tts.p...billowy-psychiatrist-32507
09/01/2025, 7:12 AMtall-airline-16756
09/01/2025, 7:13 AMfrom livekit.agents.tts import TTSCapabilities
tts = aws.TTS(
voice="Joanna",
language="en-US",
speech_engine="standard",
capabilities=TTSCapabilities(
streaming=True,
aligned_transcript=False
)
)
Don’t forget to import TTSCapabilities
from this package:
from livekit.agents.tts import TTSCapabilities
If you have any questions or want to chat more about this, just let me know—I’m here to help!
Sources: livekit-plugins/livekit-plugins-aws/livekit/plugins/aws/models.py | Amazon Polly TTS integration guide | LiveKit Docsbillowy-psychiatrist-32507
09/01/2025, 7:13 AMbillowy-psychiatrist-32507
09/01/2025, 7:14 AMtall-airline-16756
09/01/2025, 7:15 AMTypeError: TTS.__init__() got an unexpected keyword argument 'capabilities'
usually pops up because of a version mismatch or an incorrect import. No worries though, here’s a friendly step-by-step to help you fix it:
1. Check Package Versions: Make sure both livekit-agents
and livekit-plugins-aws
are up to date. You can do this by running:
`pip show livekit-agents livekit-plugins-aws`Just double-check that livekit-agents
is version 0.7.0 or higher.
2. Verify Correct Import: It’s important to import the AWS TTS class the right way:
from livekit.plugins.aws import TTS
3. Reinstall Packages: If you find the versions are off or something seems corrupted, try reinstalling:
pip uninstall livekit-agents livekit-plugins-aws
pip install livekit-agents livekit-plugins-aws
4. Check for Local Overrides: Sometimes a local file like tts.py
can accidentally shadow the LiveKit imports, so it’s good to double-check that.
If you’re still running into trouble after these steps, just let me know! Feel free to share the output of pip show livekit-agents
too, and we’ll figure it out together.
Sources: livekit-agents/livekit/agents/tts/fallback_adapter.pybillowy-psychiatrist-32507
09/01/2025, 7:27 AMtall-airline-16756
09/01/2025, 7:28 AMlivekit-agents
(1.2.6) fully supports the capabilities
parameter in TTS initialization. Just so you know, the capabilities
parameter is required by the TTS
base class and should work smoothly when you pass it a TTSCapabilities
object.
Since your package version looks good, the hiccup might be coming from the specific plugin or how it’s imported. Could you double-check that you’re importing the AWS TTS class like this?
from livekit.plugins.aws import TTS
If you’re still running into trouble, just give me a shout, and we’ll figure it out together.
Sources: livekit-plugins/livekit-plugins-cartesia/livekit/plugins/cartesia/tts.pybillowy-psychiatrist-32507
09/01/2025, 7:42 AMtall-airline-16756
09/01/2025, 7:43 AMbillowy-psychiatrist-32507
09/01/2025, 7:44 AMbillowy-psychiatrist-32507
09/01/2025, 8:14 AMbillowy-psychiatrist-32507
09/01/2025, 8:14 AMbillowy-psychiatrist-32507
09/01/2025, 8:14 AM