5-10-26 23:10:16,323 - ERROR livekit.agents - Erro...
# ask-ai
m
2025-10-26 231016,323 - ERROR livekit.agents - Error in _tts_inference_task Traceback (most recent call last): File "/home/rajabala/.env/livekit-gemini/lib/python3.12/site-packages/livekit/agents/utils/log.py", line 16, in async_fn_logs return await fn(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/rajabala/.env/livekit-gemini/lib/python3.12/site-packages/opentelemetry/util/_decorator.py", line 71, in async_wrapper return await func(*args, **kwargs) # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/rajabala/.env/livekit-gemini/lib/python3.12/site-packages/livekit/agents/voice/generation.py", line 222, in _tts_inference_task async for audio_frame in tts_node: File "/home/rajabala/.env/livekit-gemini/lib/python3.12/site-packages/livekit/agents/voice/agent.py", line 415, in tts_node if not activity.tts.capabilities.streaming: ^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'tuple' object has no attribute 'capabilities' {"pid": 146755, "job_id": "AJ_8fGWRsEcrXmP"} what is the error. unable to use gemini TTS model
t
Thanks for reaching out, Rajadurai. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
It looks like the error is happening because the code is trying to access the
capabilities
attribute on a tuple instead of a proper TTS instance. This usually occurs when a function that’s supposed to return a TTS object ends up returning a tuple instead. Let’s walk through some steps to help you resolve this: 1. First, check the function that initializes or returns the TTS object. Make sure it’s returning the TTS instance directly and not a tuple. For example:
Copy code
# Incorrect - returns a tuple
def create_tts():
    tts = gemini.TTS(model="gemini-2.5-flash-preview-tts")
    return tts, "success"  # This creates a tuple!

# Correct - returns the TTS instance
def create_tts():
    return gemini.TTS(model="gemini-2.5-flash-preview-tts")
1. Next, verify that the TTS object is properly set up in your agent configuration. For example:
Copy code
agent = Agent(
    tts=gemini.TTS(
        model="gemini-2.5-flash-preview-tts",
        voice_name="Kore"
    )
)
1. It can also help to add some debugging statements to check the type of the object before you access `capabilities`:
Copy code
print(type(your_tts_object))  # This should show a TTS instance, not a tuple
By tracing where the tuple might be getting created and ensuring you’re working with the correct TTS object, you’ll be able to fix this issue. If you’d like, I’m here to help you further—just let me know! Sources: examples/other/text-to-speech/rime_tts.py