<#C088ZNU7QQ5|> how i can use Amazon polly TTS in ...
# ask-ai
b
#C088ZNU7QQ5 how i can use Amazon polly TTS in my agentSession session = AgentSession( llm=openai.LLM(model=LLM_MODEL_NAME), stt=openai.STT(language=VoiceConfig.language, model=STT_MODEL_NAME), tts=openai.TTS(model="gpt-4o-mini-tts", voice=VoiceConfig.agent_voice_name), vad=ctx.proc.userdata["vad"], preemptive_generation=True, user_away_timeout=30 ) In place gpt4o-mini-tts from openai, i want to use amazon polly TTS
t
Thanks for reaching out, Mayank. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hey there! If you want to switch from OpenAI TTS to Amazon Polly TTS in your
AgentSession
, 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:
Copy code
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:
Copy code
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:
Copy code
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 Docs
b
I followed your steps
tts=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"}
t
Hey there! That error
AttributeError: '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:
Copy code
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...
b
tts = aws.TTS( voice="Joanna", language="en-US", speech_engine="standard", capabilities=TTSCapabilities(streaming=True, aligned_transcript=False), ) is it correct according to my configuration? and what from which package i have to import TTSCapabilities
t
It looks like your configuration for Amazon Polly TTS is spot on! Just to keep things clear, here’s the updated code snippet:
Copy code
from 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:
Copy code
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 Docs
b
thanks
i got the another error Traceback (most recent call last): 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\ipc\job_proc_lazy_main.py", line 240, in _traceable_entrypoint await self._job_entrypoint_fnc(job_ctx) File "C:\Users\mayanksingh01\Desktop\livekit\cashmere-ai-support-agent\app.py", line 53, in entrypoint tts = aws.TTS( ^^^^^^^^ TypeError: TTS.__init__() got an unexpected keyword argument 'capabilities' {"message": "unhandled exception while running the job task", "level": "ERROR", "name": "livekit.agents", "exc_info": "Traceback (most recent call last):\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\\ipc\\job_proc_lazy_main.py\", line 240, in _traceable_entrypoint\n await self._job_entrypoint_fnc(job_ctx)\n File \"C:\\Users\\mayanksingh01\\Desktop\\livekit\\cashmere-ai-support-agent\\app.py\", line 53, in entrypoint\n tts = aws.TTS(\n ^^^^^^^^\nTypeError: TTS.__init__() got an unexpected keyword argument 'capabilities'", "timestamp": "2025-09-01T071401.092022+00:00"}
t
Hey there! That error
TypeError: 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:
Copy code
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.py
b
Name: livekit-agents Version: 1.2.6 Summary: A powerful framework for building realtime voice AI agents Home-page: Author: Author-email: LiveKit <hello@livekit.io> License-Expression: Apache-2.0 Location: C:\Python312\Lib\site-packages Requires: aiohttp, av, click, colorama, docstring-parser, eval-type-backport, livekit, livekit-api, livekit-blingfire, livekit-protocol, nest-asyncio, numpy, opentelemetry-api, opentelemetry-exporter-otlp, opentelemetry-sdk, prometheus-client, protobuf, psutil, pydantic, pyjwt, sounddevice, types-protobuf, typing-extensions, watchfiles Required-by: livekit-plugins-aws, livekit-plugins-openai, livekit-plugins-silero, livekit-plugins-turn-detector above is the output of pip show livekit-agents command
t
Hey there! Your version of
livekit-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?
Copy code
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.py
b
import asyncio import logging from livekit.agents import ( AgentSession, JobContext, JobProcess, WorkerOptions, cli, metrics, AgentFalseInterruptionEvent, RoomInputOptions, UserStateChangedEvent, MetricsCollectedEvent, ) from livekit.plugins import openai, silero, noise_cancellation, aws from src.api.routes import run_fastapi from src.utils.config import ( LLM_MODEL_NAME, STT_MODEL_NAME, USE_POLLY, VoiceConfig, LoadBalancingConfig, ) from src.utils.logger import setup_logging from src.voice_assistant import Assistant from dotenv import load_dotenv load_dotenv() disconnect_task = None def prewarm(proc: JobProcess) -> None: proc.userdata["vad"] = silero.VAD.load( min_speech_duration=VoiceConfig.min_speech_duration, min_silence_duration=VoiceConfig.min_silence_duration, activation_threshold=VoiceConfig.activation_threshold, force_cpu=VoiceConfig.force_cpu, padding_duration=VoiceConfig.padding_duration, max_buffered_speech=VoiceConfig.max_buffered_speech, ) async def entrypoint(ctx: JobContext) -> None: logger = logging.getLogger("support-assistant") logger.info("Initializing support assistant...") await ctx.connect() session = AgentSession( llm=openai.LLM(model=LLM_MODEL_NAME), stt=openai.STT(language=VoiceConfig.language, model=STT_MODEL_NAME), tts= aws.TTS( voice="Joanna", language="en-US", speech_engine="standard", region="us-east-1", ), vad=ctx.proc.userdata["vad"], preemptive_generation=True, user_away_timeout=5, ) @session.on("user_state_changed") def _on_user_state_changed(ev: UserStateChangedEvent): global disconnect_task if ev.new_state == "away": logger.info("User inactive 30s → asking if they are still there...") session.generate_reply(instructions="ask user if they are still there") # Start a background disconnect timer async def delayed_disconnect(): await asyncio.sleep(15) # wait another 15s # Check if still away if session.user_state == "away": logger.info("No response after warning → disconnecting") try: await ctx.delete_room() except Exception as e: logger.warning( f"Room deletion raised (likely already closed): {e}" ) disconnect_task = asyncio.create_task(delayed_disconnect()) elif ev.new_state == "active": logger.info("User became active again, cancelling pending disconnect") if disconnect_task and not disconnect_task.done(): disconnect_task.cancel() disconnect_task = None @session.on("agent_false_interruption") def _on_false_interrupt(ev: AgentFalseInterruptionEvent): logger.info("False positive interruption detected, resuming...") session.generate_reply(instructions=ev.extra_instructions or "") usage_collector = metrics.UsageCollector() @session.on("metrics_collected") def _on_metrics_collected(ev: MetricsCollectedEvent): metrics.log_metrics(ev.metrics) usage_collector.collect(ev.metrics) async def log_usage(): summary = usage_collector.get_summary() logger.info(f"Usage summary: {summary}") ctx.add_shutdown_callback(log_usage) await session.start( agent=Assistant(), room=ctx.room, room_input_options=RoomInputOptions( noise_cancellation=noise_cancellation.BVC(), ), ) try: await session.say( "Hi there! I'm Maya, your voice assistant specialized in personalized skincare consultations. " "Are you looking for skincare products, or a gift for someone?", allow_interruptions=False, ) logger.info("Initial greeting delivered to user") except Exception as e: logger.error(f"Failed to deliver greeting: {e}") if name == "__main__": setup_logging() worker_opts = WorkerOptions( entrypoint_fnc=entrypoint, load_threshold=LoadBalancingConfig.load_threshold, num_idle_processes=LoadBalancingConfig.num_idle_processes, max_retry=LoadBalancingConfig.max_retry, shutdown_process_timeout=LoadBalancingConfig.shutdown_timeout, initialize_process_timeout=LoadBalancingConfig.initialize_timeout, prewarm_fnc=prewarm, ) cli.run_app(worker_opts) getting following errros: [2025-09-01 130922] [WARNING] livekit.agents: failed to synthesize speech, retrying in 0.1s Traceback (most recent call last): File "C:\Python312\Lib\site-packages\livekit\plugins\aws\tts.py", line 130, in _run response = await client.synthesize_speech( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python312\Lib\site-packages\aiobotocore\context.py", line 36, in wrapper return await func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python312\Lib\site-packages\aiobotocore\client.py", line 424, in _make_api_call raise error_class(parsed_response, operation_name) botocore.exceptions.ClientError: An error occurred (UnrecognizedClientException) when calling the SynthesizeSpeech operation (reached max retries: 0): The security token included in the request is invalid. The above exception was the direct cause of the following exception: Traceback (most recent call last): File "C:\Python312\Lib\site-packages\livekit\agents\tts\tts.py", line 231, in _main_task await self._run(output_emitter) File "C:\Python312\Lib\site-packages\livekit\plugins\aws\tts.py", line 158, in _run raise APIConnectionError() from e livekit.agents._exceptions.APIConnectionError: Connection error. (body=None, retryable=True) {"message": "failed to synthesize speech, retrying in 0.1s", "level": "WARNING", "name": "livekit.agents", "exc_info": "Traceback (most recent call last):\n File \"C:\\Python312\\Lib\\site-packages\\livekit\\plugins\\aws\\tts.py\", line 130, in _run\n response = await client.synthesize_speech(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Python312\\Lib\\site-packages\\aiobotocore\\context.py\", line 36, in wrapper\n return await func(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Python312\\Lib\\site-packages\\aiobotocore\\client.py\", line 424, in _make_api_call\n raise error_class(parsed_response, operation_name)\nbotocore.exceptions.ClientError: An error occurred (UnrecognizedClientException) when calling the SynthesizeSpeech operation (reached max retries: 0): The security token included in the request is invalid.\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"C:\\Python312\\Lib\\site-packages\\livekit\\agents\\tts\\tts.py\", line 231, in _main_task\n await self._run(output_emitter)\n File \"C:\\Python312\\Lib\\site-packages\\livekit\\plugins\\aws\\tts.py\", line 158, in _run\n raise APIConnectionError() from e\nlivekit.agents._exceptions.APIConnectionError: Connection error. (body=None, retryable=True)", "tts": "livekit.plugins.aws.tts.TTS", "attempt": 1, "streamed": false, "timestamp": "2025-09-01T073922.622523+00:00"} [2025-09-01 130924] [WARNING] livekit.agents: failed to synthesize speech, retrying in 2.0s Traceback (most recent call last): File "C:\Python312\Lib\site-packages\livekit\plugins\aws\tts.py", line 130, in _run response = await client.synthesize_speech( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python312\Lib\site-packages\aiobotocore\context.py", line 36, in wrapper return await func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python312\Lib\site-packages\aiobotocore\client.py", line 424, in _make_api_call raise error_class(parsed_response, operation_name) botocore.exceptions.ClientError: An error occurred (UnrecognizedClientException) when calling the SynthesizeSpeech operation (reached max retries: 0): The security token included in the request is invalid. The above exception was the direct cause of the following exception: Traceback (most recent call last): File "C:\Python312\Lib\site-packages\livekit\agents\tts\tts.py", line 231, in _main_task await self._run(output_emitter) File "C:\Python312\Lib\site-packages\livekit\plugins\aws\tts.py", line 158, in _run raise APIConnectionError() from e livekit.agents._exceptions.APIConnectionError: Connection error. (body=None, retryable=True) {"message": "failed to synthesize speech, retrying in 2.0s", "level": "WARNING", "name": "livekit.agents", "exc_info": "Traceback (most recent call last):\n File \"C:\\Python312\\Lib\\site-packages\\livekit\\plugins\\aws\\tts.py\", line 130, in _run\n response = await client.synthesize_speech(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Python312\\Lib\\site-packages\\aiobotocore\\context.py\", line 36, in wrapper\n return await func(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Python312\\Lib\\site-packages\\aiobotocore\\client.py\", line 424, in _make_api_call\n raise error_class(parsed_response, operation_name)\nbotocore.exceptions.ClientError: An error occurred (UnrecognizedClientException) when calling the SynthesizeSpeech operation (reached max retries: 0): The security token included in the request is invalid.\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"C:\\Python312\\Lib\\site-packages\\livekit\\agents\\tts\\tts.py\", line 231, in _main_task\n await self._run(output_emitter)\n File \"C:\\Python312\\Lib\\site-packages\\livekit\\plugins\\aws\\tts.py\", line 158, in _run\n raise APIConnectionError() from e\nlivekit.agents._exceptions.APIConnectionError: Connection error. (body=None, retryable=True)", "tts": "livekit.plugins.aws.tts.TTS", "attempt": 2, "streamed": false, "timestamp": "2025-09-01T073924.379234+00:00"}
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!
b
[2025-09-01 130922] [WARNING] livekit.agents: failed to synthesize speech, retrying in 0.1s Traceback (most recent call last): File "C:\Python312\Lib\site-packages\livekit\plugins\aws\tts.py", line 130, in _run response = await client.synthesize_speech( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python312\Lib\site-packages\aiobotocore\context.py", line 36, in wrapper return await func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python312\Lib\site-packages\aiobotocore\client.py", line 424, in _make_api_call raise error_class(parsed_response, operation_name) botocore.exceptions.ClientError: An error occurred (UnrecognizedClientException) when calling the SynthesizeSpeech operation (reached max retries: 0): The security token included in the request is invalid. The above exception was the direct cause of the following exception: Traceback (most recent call last): File "C:\Python312\Lib\site-packages\livekit\agents\tts\tts.py", line 231, in _main_task await self._run(output_emitter) File "C:\Python312\Lib\site-packages\livekit\plugins\aws\tts.py", line 158, in _run raise APIConnectionError() from e livekit.agents._exceptions.APIConnectionError: Connection error. (body=None, retryable=True) {"message": "failed to synthesize speech, retrying in 0.1s", "level": "WARNING", "name": "livekit.agents", "exc_info": "Traceback (most recent call last):\n File \"C:\\Python312\\Lib\\site-packages\\livekit\\plugins\\aws\\tts.py\", line 130, in _run\n response = await client.synthesize_speech(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Python312\\Lib\\site-packages\\aiobotocore\\context.py\", line 36, in wrapper\n return await func(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Python312\\Lib\\site-packages\\aiobotocore\\client.py\", line 424, in _make_api_call\n raise error_class(parsed_response, operation_name)\nbotocore.exceptions.ClientError: An error occurred (UnrecognizedClientException) when calling the SynthesizeSpeech operation (reached max retries: 0): The security token included in the request is invalid.\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"C:\\Python312\\Lib\\site-packages\\livekit\\agents\\tts\\tts.py\", line 231, in _main_task\n await self._run(output_emitter)\n File \"C:\\Python312\\Lib\\site-packages\\livekit\\plugins\\aws\\tts.py\", line 158, in _run\n raise APIConnectionError() from e\nlivekit.agents._exceptions.APIConnectionError: Connection error. (body=None, retryable=True)", "tts": "livekit.plugins.aws.tts.TTS", "attempt": 1, "streamed": false, "timestamp": "2025-09-01T073922.622523+00:00"} [2025-09-01 130924] [WARNING] livekit.agents: failed to synthesize speech, retrying in 2.0s Traceback (most recent call last): File "C:\Python312\Lib\site-packages\livekit\plugins\aws\tts.py", line 130, in _run response = await client.synthesize_speech( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python312\Lib\site-packages\aiobotocore\context.py", line 36, in wrapper return await func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python312\Lib\site-packages\aiobotocore\client.py", line 424, in _make_api_call raise error_class(parsed_response, operation_name) botocore.exceptions.ClientError: An error occurred (UnrecognizedClientException) when calling the SynthesizeSpeech operation (reached max retries: 0): The security token included in the request is invalid. The above exception was the direct cause of the following exception: Traceback (most recent call last): File "C:\Python312\Lib\site-packages\livekit\agents\tts\tts.py", line 231, in _main_task await self._run(output_emitter) File "C:\Python312\Lib\site-packages\livekit\plugins\aws\tts.py", line 158, in _run raise APIConnectionError() from e livekit.agents._exceptions.APIConnectionError: Connection error. (body=None, retryable=True) {"message": "failed to synthesize speech, retrying in 2.0s", "level": "WARNING", "name": "livekit.agents", "exc_info": "Traceback (most recent call last):\n File \"C:\\Python312\\Lib\\site-packages\\livekit\\plugins\\aws\\tts.py\", line 130, in _run\n response = await client.synthesize_speech(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Python312\\Lib\\site-packages\\aiobotocore\\context.py\", line 36, in wrapper\n return await func(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Python312\\Lib\\site-packages\\aiobotocore\\client.py\", line 424, in _make_api_call\n raise error_class(parsed_response, operation_name)\nbotocore.exceptions.ClientError: An error occurred (UnrecognizedClientException) when calling the SynthesizeSpeech operation (reached max retries: 0): The security token included in the request is invalid.\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"C:\\Python312\\Lib\\site-packages\\livekit\\agents\\tts\\tts.py\", line 231, in _main_task\n await self._run(output_emitter)\n File \"C:\\Python312\\Lib\\site-packages\\livekit\\plugins\\aws\\tts.py\", line 158, in _run\n raise APIConnectionError() from e\nlivekit.agents._exceptions.APIConnectionError: Connection error. (body=None, retryable=True)", "tts": "livekit.plugins.aws.tts.TTS", "attempt": 2, "streamed": false, "timestamp": "2025-09-01T073924.379234+00:00"} can you tell why i got this error and how to fix it
thanks
i resolved my issue
after reinstalling the livekit dependencies